jojovalenton
26th July 2018, 11:09
hi,

anybody know how to convert long results of system time.num() into hr:mn.se visually like 17:10:00 or 5:10 PM whichever? i can't find any function like date conversion date.to.utc(), I need num.to.time(), does any function similar to this? thanks.

regards,
jojo

bdittmar
26th July 2018, 11:41
Hello,


utc.to.date()
Syntax:

function long utc.to.date (long utc, ref long yearno, ref long monthno, ref long month_dayno, ref long hours, ref long minutes, ref long seconds)

Description

This converts a UTC long format value to the corresponding year, month, day, and so on, in local time.

Arguments

long utc
ref long yearno
ref long monthno
ref long month_dayno
ref long hours
ref long minutes
ref long seconds

jojovalenton
26th July 2018, 13:41
thanks for reply. is there anything like num.to time() bec i need only to convert the time created by time.num() function.

Juergen
26th July 2018, 15:25
Hello,

maybe can also be done simply by

long x.std
long x.min
long x.sek
string x.time(8)

x.std = time.num() / 3600
x.min = (time.num() - (x.std * 3600)) / 60
x.sek = time.num() \ 60

x.time = sprintf$("%02d:%02d:%02d",x.std,x.min,x.sek)


Regards,
Juergen

jojovalenton
26th July 2018, 16:12
thanks Juergen. i will try this.

jojovalenton
7th August 2018, 15:57
thanks, it works.