fmchong
16th March 2011, 05:37
Dear Baan Experts,
I would like to convert Date adate-24/5/2010 (domain: tfgld.date) to UTC.

local.to.utc??

Please advise.

Thank you so much

amitmmokashi
16th March 2011, 06:43
Hi,
You can either use local.to.utc() or date.to.utc() depending upon the inputs you have.


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

long local.to.utc ( long local_days, long local_time, ref long utc )


Regards,
Amit Mokashi

fmchong
16th March 2011, 09:05
Dear Baan Experts,
I would like to compare 2 dates. adate is UTC format ,bdate is Date format.

adate >=:bdate

i would like to convert bdate from date to utc.

i have no idea on how to use the local.to.utc syntax. Can give example.

Thank you so much

Dipen Shethia
31st October 2017, 11:31
number conversion of Date - 01/01/1970 is 719163
1 day no. conversion is 60*60*24 = 86400
for you want to convert eg. 28/09/2017
function in excel to convert is =DATEVALUE("28/09/2017") result 43006
add - 693594 to get LN date without time ie. 43006+693594 = 736600

Now to get LN Date with time is 736600 - 719163 * 86400 = 1506537000

Result : 28/09/2017 00:00:00

bdittmar
31st October 2017, 12:17
Hello,
use date.to.utc()

date.to.utc()
Syntax:

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

Description : This converts the specified local date and time to UTC long format.

Arguments

long yearno
long monthno
long month_dayno
long hours
long minutes
long seconds

Return values

The UTC long format value.
-1 Error.

Context
This function can be used in all script types.

Example

long utc
utc = date.to.utc( 1991, 04, 20, 23, 12, 45 )


Regards