Converting DD/MM/YYYY date format to UTC

M

Matt Gyton

Can anyone help me, I need a way to convert a date in DD/MM/YYYY format
(the time is also present but that's not too important in this case....)
into a UTC integer using ASP/VBScript....for example:

The date 01/01/2006 would be converted to 1136073600

I need a formula to do this for me in ASP/VBScript.....Thanks!!
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Thu,
17 Aug 2006 17:24:05 remote, seen in Matt
Gyton said:
Can anyone help me, I need a way to convert a date in DD/MM/YYYY format
(the time is also present but that's not too important in this case....)
into a UTC integer using ASP/VBScript....for example:

The date 01/01/2006 would be converted to 1136073600

I need a formula to do this for me in ASP/VBScript.....Thanks!!


Then posting in a Javascript group seems rather a Merkin thing to do.

A local date can only be converted into UTC if the offset from Greenwich
is known. You can only get UTC if you have a list of Leap Seconds; you
can however get UT, a modernised form of GMT.

You should have explained that 1136073600 is a count of seconds from
1970.0.

Split it into DD MM & YYYY (DD/MM/YYYY will be read as FFF for DD<13),
apply to DateSerial, subtract the corresponding value for 1970.0, and
multiply by 864e2.

In Javascript, you could just use Date.UTC(Y, M-1, D)/1000

Read the newsgroup and its FAQ.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top