Jump to content

strange issue with dates


An7hony

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.