Converting DD/MM/YYYY date format to UTC

Discussion in 'Javascript' started by Matt Gyton, Aug 17, 2006.

  1. Matt Gyton

    Matt Gyton Guest

    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 ***
    Matt Gyton, Aug 17, 2006
    #1
    1. Advertising

  2. JRS: In article <44e4a635$0$34072$>, dated Thu,
    17 Aug 2006 17:24:05 remote, seen in news:comp.lang.javascript, Matt
    Gyton <> posted :

    >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.htm> jscr maths, dates, sources.
    <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
    Dr John Stockton, Aug 17, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chu
    Replies:
    3
    Views:
    4,173
    Shawn
    Aug 15, 2006
  2. Ashraf Ansari

    convert MM/dd/yyyy format into dd/MM/yyyy

    Ashraf Ansari, Aug 30, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    777
    Alexey Smirnov
    Aug 30, 2007
  3. deepak
    Replies:
    0
    Views:
    394
    deepak
    Feb 14, 2008
  4. Gilles Ganault

    Converting DD MM YYYY into YYYY-MM-DD?

    Gilles Ganault, Aug 17, 2009, in forum: Python
    Replies:
    18
    Views:
    1,331
    Mark Tolonen
    Aug 20, 2009
  5. J P Singh
    Replies:
    4
    Views:
    272
    J P Singh
    Feb 10, 2004
Loading...

Share This Page