i have a script that saves a date like this.
$date = date('i')+50;
When i store this on my database, i got something like 1382851302 wich works great to compare for past and future just using > or <.
In other part of the script for the admin im using a filter based on jquery datepicker.. the problem is i cant convert the date selected there to the same "date()" format so i can compare the date , i think time is somehow envolved here (i) and well i cant.
here is my bad try.
$iniciopub = date('Y-m-d',strtotime($_POST['iniciopub']));
$finpub = date('Y-m-d',strtotime($_POST['finpub']));
This is not working.. (it just store "1970" )
if i try this..
$iniciopub = date($_POST['iniciopub']);
$finpub = date($_POST['finpub']);
I just save the day , i think because the format is like 00/00/0000 so the / is "cutting" the value cause i can just save int. in the database as you can see in the format i need, i just nned numbers..
Really lost on this, sorry if this is a fool question.
Im studing so dont be so hard. EDIT:
Ok this is my code now im using mktime()
$iniciodate = str_replace("/",",",$_POST['iniciopub']);
$iniciopub = mktime(0,0,0,$iniciodate);
$findate = str_replace("/",",",$_POST['finpub']);
$finpub = mktime(0,0,0,$findate);
This saves this to timestamps for 10/27/2013 = 1382824800 but the same for 10/31/2013
ALso im using this format, i have not problem with it
dateFormat: 'mm/dd/yy',
This is now set in datepicker jquery ui