pralash
17th November 2017, 06:28
Hi,

Is there any predefined BaaN SQL oriented built function is available for converting the timestamp(UTC) data type into date data type?

Can anybody please let me know if there is a option is available?
Thanks in advance,
Regards,
Pralash

bhushanchanda
17th November 2017, 07:48
Hi,

If you want to convert UTC Date to Date - try this -

domain tfgld.date o.date
domain tcdate i.date
long yy,mm,dd,hh,mn,ss

i.date = utc.num()

utc.to.date(i.date,yy,mm, dd,hh,mm, ss)
o.date = date.to.num (yy, mm, dd)

If you want to convert UTC Date to String Date - refer to sprintf$()

domain tcdate i.date
string o.date(80)
i.date = utc.num()
o.date = sprintf$("%u(%02d/%02m/%04Y)", o.date) |# Convert date to string in format dd/mm/yyyy

pralash
17th November 2017, 11:07
Hello bhushanchanda,
Thanks so much for your reply.... Your posting are very useful for me to grow in LN learning....
Regards,
Pralash