Jump to content

Date is wrong!


rwahdan

Recommended Posts

hi,

 

i am trying to convert an input field that is used by date picker then convert the date from d-m-Y to Y-m-d so that i can check mysql database and get results but i am getting wrong dates!

 

i found the problem and i dont know why it is doing this!!!!!!

 

 

 

$thestartdate = $_POST['startdate'];

$thestartdate1 = date("Y-m-d", strtotime($thestartdate));

$theenddate=$_POST['enddate'];

$theenddate1 = date("Y-m-d", strtotime($theenddate));

 

 

echo "$thestartdate1 $theenddate1";

echo '<br>';

echo "$thestartdate $theenddate";

 

 

 

the first result is wrong! the second is ok!!!!!! why is that!!!!!

 

check: http://tamouh-salesoffice.com/tamouh/reportsgenerator.php

Link to comment
https://forums.phpfreaks.com/topic/150100-date-is-wrong/
Share on other sites

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.