thepip3r Posted February 6, 2009 Share Posted February 6, 2009 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 Link to comment https://forums.phpfreaks.com/topic/144121-solved-need-unix-timestamp-help-dates-before-1900/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 6, 2009 Share Posted February 6, 2009 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. Link to comment https://forums.phpfreaks.com/topic/144121-solved-need-unix-timestamp-help-dates-before-1900/#findComment-756230 Share on other sites More sharing options...
thepip3r Posted February 6, 2009 Author Share Posted February 6, 2009 ty pfmabismad Link to comment https://forums.phpfreaks.com/topic/144121-solved-need-unix-timestamp-help-dates-before-1900/#findComment-756232 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.