Web Analytics Made Easy -
StatCounter Strtotime returns -1 in php 4 - CodingForum

Announcement

Collapse
No announcement yet.

Strtotime returns -1 in php 4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strtotime returns -1 in php 4

    I have previously used the following function successfully in php 5 to return the timestamp of the first day in a week, given the year and week number:

    strtotime($year.'W'.$week.$i);

    e.g.:

    strtotime('2009W150'); // year=2009 ; week=15th week of year ; 0 means: first day of week (Sunday)

    but for some reason it does not work in php 4 - it returns -1.

    Anybody knows a workaround for this?

    Basically what I need to do is get the timestamp of the first day in a week (week starting on Sunday), given a year and a week number.
    Last edited by Tafalezono; Apr 8, 2009, 01:20 PM.

  • #2
    Did you try "Sunday" rather than "0"?

    Comment


    • #3
      Originally posted by Fumigator View Post
      Did you try "Sunday" rather than "0"?
      That doesn't work.

      Comment

      Working...
      X