tags:

views:

89

answers:

2

Hello, i have a "simple" problem with the PHP timestamp (on a linux machine).

I need to get the user birthdate in year-month-date (using 3 menus - html select). When the user is born on 1970-1-1 the timestamp is zero and the application logic gets everything wrong.

How would you deal with this case?

Regards,

+2  A: 

As long as your dates are between the years 1901-2038 the PHP native date functions should work OK. Timestamps should not be used for birth dates. If you need to use dates outside if this range, take a look at the ADOdb Date Time Library.

Espo
A: 

Try using built in DateTime class instead (http://php.net/manual/en/class.datetime.php)

alexeit