SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2009
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    gmmktime with invalid parameters

    hi,
    i would like to calculate seconds for year lessthan 1900 and greaterthan 2037.
    but gmmktime will accept 1902 to 2037 years only.
    is there any other way to get result?

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    The DateTime object has no such limitations.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2009
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually i used gmmktime for the years,
    => gmmktime(0,0,0,1,1,1900); or gmmktime(0,0,0,1,1,2099);
    But gmmtime wont accept year 1900 or 2099.
    is there any other way to get result as seconds for those years?

  4. #4
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,397
    Mentioned
    63 Post(s)
    Tagged
    0 Thread(s)
    Use DateTime!
    Salathe
    Software Developer and PHP Manual Author.


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
  •