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? Quote 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? Quote 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 Quote 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() Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/40440-solved-date-format/#findComment-195700 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.