An7hony Posted October 25, 2011 Share Posted October 25, 2011 Can anyone help? the date is pulling through without a value shown in bold below. `Timesheet_start_date` >= '2011-02-10 00:00:00' AND `Timesheet_end_date` <= '1970-01-01 00:00:00' ORDER BY id DESC here is my code: $smalldate = $_POST['small']; $largedate = $_POST['large']; $types[] = (isset($_POST['small']) && strlen(trim($_POST['small'])) > 0) ? "`Timesheet_start_date` >= '".date('Y-m-d',strtotime($smalldate))." 00:00:00'" : ''; $types[] = (isset($_POST['large']) && strlen(trim($_POST['large'])) > 0) ? "`Timesheet_end_date` <= '".date('Y-m-d',strtotime($largedate))." 00:00:00'" : ''; i've echo the $largedate and there is a value in there? Link to comment https://forums.phpfreaks.com/topic/249779-strange-issue-with-dates/ Share on other sites More sharing options...
Buddski Posted October 25, 2011 Share Posted October 25, 2011 Can you show us what is actually contained in $largedate Link to comment https://forums.phpfreaks.com/topic/249779-strange-issue-with-dates/#findComment-1282091 Share on other sites More sharing options...
An7hony Posted October 25, 2011 Author Share Posted October 25, 2011 $largedate has: 25/10/2011 $smalldate has: 02/10/2011 Link to comment https://forums.phpfreaks.com/topic/249779-strange-issue-with-dates/#findComment-1282093 Share on other sites More sharing options...
Buddski Posted October 25, 2011 Share Posted October 25, 2011 This is my most hated thing.. dates. 25/10/2011 can either be read as "The 25th day of the 10th Month" (Aussie dates) or "The 10th day of the 25th Month" PHP has decided to choose the latter, which isnt a real date thus returning a 0 for strtotime. Link to comment https://forums.phpfreaks.com/topic/249779-strange-issue-with-dates/#findComment-1282095 Share on other sites More sharing options...
An7hony Posted October 25, 2011 Author Share Posted October 25, 2011 thanks, you are right. What a pain.. Link to comment https://forums.phpfreaks.com/topic/249779-strange-issue-with-dates/#findComment-1282098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.