I have the following code
date("D j M g a", strtotime($start))." - " . date("ga", strtotime($finish));
`["Start"]=>
string(21) "/Date(1354323600000)/"
["End"]=>
string(21) "/Date(1354326300000)/"
}`
The above code outputs Thu 1 Jan 12 pm - 12pm" string(22) "Thu 1 Jan 12 pm - 12pm in the correct format that I want but how could I get the day date and time correct.
Pacific/Auckland is my timezone
The issue is that what you pass to the
strtotime–/Date(1354323600000)/string is not in a valid format forstrtotimefunction.And actually it’s a regular unix timestamp in milliseconds.
So the obvious solution – is to clean up everything but numbers and divide it by 1000: