My GPS device is communicating to my php web services, it sends date=311011 and time=060904 formats.
$time=str_split($time,2);
$date=str_split($date,2);
$time=implode(":",$time);
$date=implode("-",$date);
This gives me the required date and time standard notations.
- date=31-10-11
- time=06:09:04
Now, i wanna convert this date, time to timestamp. I worked with strtotime(), but the date seems to be 31-10-11, which gives strange results. Do i have to append 20 to 11 statically to make it 2011, or any solution
take a look at the date fortmats. if you use
-as separator, php assumes it’sy-mm-dd, but your order isdd-mm-y. the easiest way would be to change the separator to.wich would then bedd.mm.y.