I'm trying to get a timestamp from a date before 1970, and I can't seem to do it. The result is -1 every time I try. How do you get a timestamp from before Jan. 1, 1970???

I need this for a family events site I'm building. In other words, I need to be able to show how old someone will be on a given date, how many days until their next birthday, etc.

Thanks,

Brad

    timestamps are based on the unix time function which starts in 1970. You could just use a date, it woun't care what the date value is...

      Here's an example of what does not work:

      <code>

      $today = date("F j, Y, g:i a", mktime(0,0,0,7,22,1965));
      echo "$today";

      </code>

      If you put in a year of 1970 or later, it works fine. Put in 1969 or earlier and you get an error. When I do get similar code to run, the only response on a date prior to 1/1/1970 is "-1". If I try to output the result into a normal date output, I always get just "12/31/1969", or what should be a date of "-1" in Unix speak.

      I assume that dates prior to 1/1/1970 result in negative numbers. Why I can't get the code to go beyond -1 is a mystery to me.

      HELP!

        As briefly explained by Bastian. You cannot create a timestamp prior to 1970. Therefore, mktime() will not work.

        You will have to create your own function to convert formats of dates prior to 1970.

        Sorry.

          Write a Reply...