jbaanm
2nd January 2013, 20:13
what is the similar function in LN for UTC Date field conversion as we had in BaanIV as date.to.inputstr$(....)?

I want to convert a UTC date field to a real date formatted in a string field.

Thanks in advance...

Jay

vahdani
2nd January 2013, 22:49
Hi Jay,

function sprintf$() should do the trick. Hier from an example from programmers guide:


string result(80)

result = sprintf$("UTC: %u(%02d/%02m/%04Y) %U(%02h%x%02m%x%02s %a)", utc.num(), utc.num())

| result contains "UTC: 22/07/1997 06:24:53 am"

mjamsek
3rd January 2013, 13:05
or

Syntax:
function long utc.to.inputstr$ (long utc, string date.format(7), string time.format(7), ref string local.date(), ref string local.time())

Description

This converts a UTC long format value to a local date string and a local time string.


Arguments
long utc A UTC long format value.

string date.format(7) Indicates the format for the returned date string, by using the substitution symbols %u xxx [, lang] .

string time.format(7) Indicates the format for the returned time string, by using the substitution symbols %U xxx [, lang] .

ref string local.date() The returned local date string.

ref string local.time() The returned local time string.



This is from Progguide.

Regards,
JM