Jump to content

[SOLVED] Need Unix timestamp help. dates before 1900


thepip3r

Recommended Posts

does php provide any method of storing dates in a non-long format for dates prior to 1900?

 

To give you an example, I'm trying to store Thomas Hobbes life in my database but his lifespan was 5 April 1588 - 4 December 1679

 

I'd like to be able to convert that to smaller data chunks for my db but can't seem to find a way inherent to php that will allow me to do so.  Any suggestions would be greatly appreciated.

 

Edit:  if nothing else, I suppose I'll just use ddmmyyyy

Use a DATE data type in your database. It does not have the 1970/1900/2038 limitations of a Unix Timestamp.

 

Edit: And if the issue is converting from/to a format like 4 December 1679, use the mysql STR_TO_DATE() and DATE_FORMAT() functions in your queries.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.