Asheeown Posted February 28, 2007 Share Posted February 28, 2007 When this date: 2007-2-1 00:00:00 Is compared with this in the database: 2007-02-01 00:00:00 It does not match up, how can I change that date format to add the leading zeros? Link to comment https://forums.phpfreaks.com/topic/40440-solved-date-format/ Share on other sites More sharing options...
artacus Posted February 28, 2007 Share Posted February 28, 2007 Is the first one an actual date or is it a string? Link to comment https://forums.phpfreaks.com/topic/40440-solved-date-format/#findComment-195691 Share on other sites More sharing options...
Asheeown Posted February 28, 2007 Author Share Posted February 28, 2007 It's a string Link to comment https://forums.phpfreaks.com/topic/40440-solved-date-format/#findComment-195692 Share on other sites More sharing options...
artacus Posted February 28, 2007 Share Posted February 28, 2007 So convert it to a date first STR_TO_DATE() Link to comment https://forums.phpfreaks.com/topic/40440-solved-date-format/#findComment-195696 Share on other sites More sharing options...
Asheeown Posted February 28, 2007 Author Share Posted February 28, 2007 Thanks, perfect. Link to comment https://forums.phpfreaks.com/topic/40440-solved-date-format/#findComment-195700 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.