SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    javascript to figure greenwich mean time

    Im trying to find some javascript that figures out the greenwich mean time (gmt). Anyone know of a good place to work or have done this already in the past? Thanks in advance....

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try this:
    curdate=new Date()
    curmonth=curdate.getMonth()
    curday=curdate.getDate()
    curhours=curdate.getHours()
    curmins=curdate.getMinutes()
    cursecs=curdate.getSeconds()
    curmilsecs=curdate.getMilliseconds()
    temputc=Date.UTC(curyear,curmonth,curday,curhours,curmins,cursecs,curmilsecs)
    newdate=new Date(temputc)

    the variable newdate should contain the (GMT) time.

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2000
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    curdate = new Date();
    curdate.toGMTString();

    I think this should work too.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •