Jump to content

strange issue with dates


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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.