cancel
Showing results for 
Search instead for 
Did you mean: 

Date Time Conversions

abirhasan
Master User

I'm trying to convert my date and time to a better format so I can compare it to a time and date 36 hours from now. Then I plan to compare these two so I can see which date is earlier.

My problem is that I can't just use the typical methods because the code is mixing my day and month.

 

$orig= $v_CurrentRecordD['day'].",  ".$v_CurrentRecordD['time']; //MM/DD/YYYY, HH:MM
$conv = date('m/d/Y H:i', strtotime($orig));
$daycutoff = date('m/d/Y H:i', strtotime("+36 hours"));
echo $orig."-".$conv."-".$daycutoff." <br />";  


Output 
06-20-2013, 8:00am-12/31/1969 18:00-06/05/2013 22:56
02-11-2013, 8:45am-11/02/2013 08:45-06/05/2013 22:56
02-11-2013, 8:15am-11/02/2013 08:15-06/05/2013 22:56
02-11-2013, 8:00am-11/02/2013 08:00-06/05/2013 22:56
06-01-2012, 10:15am-01/06/2012 10:15-06/05/2013 22:56
02-11-2013, 8:30am-11/02/2013 08:30-06/05/2013 22:56
02-12-2013, 10:45am-12/02/2013 10:45-06/05/2013 22:56
02-12-2013, 10:30am-12/02/2013 10:30-06/05/2013 22:56 

 Any help?

0 REPLIES 0