why date('d/m/y',strtotime(return_time()) not working in php -
i've function, sends current date , time of asia region
function return_time() { if(function_exists('date_default_timezone_set')) { date_default_timezone_set('asia/kolkata'); } return date('y-m-d h:i:s a'); } and i'm trying show today's date user, don't know i'm doing wrong, here i'm doing
echo date('d/m/y',strtotime(return_time())) here i'm getting in output
01/01/70
having a formatter in date() outputs invalid date string causes strtotime() return false causes date() think 0 equates unix epoch jan 1, 1970.
the a necessary since time in 24 hour format. remove it.
i don't know why have convoluted, though. if want print out today's date do:
echo date('d/m/y');
Comments
Post a Comment