Author Topic: negative timestamps converting to date  (Read 266 times)

0 Members and 1 Guest are viewing this topic.

Offline c_shelswellTopic starter

  • Enthusiast
    • View Profile
negative timestamps converting to date
« on: February 05, 2007, 07:19:20 AM »
I've been given a database where they've decided to put the date of birth as a timestamp. They've delt with dates prior to 1970 by using negative numbers. I'm trying to convert them back to real dates is there and easy way of converting the negative numbers back?

Cheers

Offline richardw

  • Enthusiast
  • Gender: Male
    • View Profile
    • The City of Providence
Re: negative timestamps converting to date
« Reply #1 on: February 05, 2007, 08:41:08 AM »
Try using substr, this works for me

$daystring = $row["birthdate"];
$month = substr($daystring, 4, 2);
$day = substr($daystring, 6, 2);
$year = substr($daystring, 0, 4);

Best,

 :)
Richard W

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.