Connecting Tech Pros Worldwide Help | Site Map

Converting DD/MM/YYYY date format to UTC

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 17th, 2006, 05:15 PM
Matt Gyton
Guest
 
Posts: n/a
Default Converting DD/MM/YYYY date format to UTC

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!!



*** Sent via Developersdex http://www.developersdex.com ***

  #2  
Old August 17th, 2006, 10:25 PM
Dr John Stockton
Guest
 
Posts: n/a
Default Re: Converting DD/MM/YYYY date format to UTC

JRS: In article <44e4a635$0$34072$815e3792@news.qwest.net>, dated Thu,
17 Aug 2006 17:24:05 remote, seen in news:comp.lang.javascript, Matt
Gyton <matt.gyton@ntlworld.composted :
Quote:
>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.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.