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? Quote 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 Quote 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 Quote 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. Quote 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.. Quote Link to comment https://forums.phpfreaks.com/topic/249779-strange-issue-with-dates/#findComment-1282098 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.