SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: utc timestamp

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2011
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    utc timestamp

    Hello,

    I just want to make sure that the following bit of code: gmdate("Y-m-d\TH:i:s\Z"); is at no point and under no circumstance platform related, localized etc. That no matter where you run ti, you get a utc UNIX timestamp.


  2. #2
    SitePoint Zealot
    Join Date
    Jul 2011
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bump

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    Well, it is bit-limited in that it can only do dates up until 2038 (The End of the 32-bit Date Scheme, aka the "Year 2038 Problem"). This problem will likely not actually affect many systems by the time it comes around (as presumably virtually all systems will have advanced to using a 64-bit time key by then).

    As this function still is reliant upon the system local time, it is vulnerable to an off system clock; if the time UTC is 12:00:00 but your system thinks its 08:04:00 -0400, then it will spit out a date of 2012-07-23T12:04:00Z.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


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
  •