Welcome Guest, Not a member yet? Register   Sign In
Timestamp to DateTime
#1

[eluser]codelearn[/eluser]
Hi Guys,

I found a function to convert DateTime to Timestamp ($event_date is in datetime format):

Code:
list($date, $time) = explode(' ', $event_date);
            list($year, $month, $day) = explode('-', $date);
            list($hour, $minute, $second) = explode(':', $time);
            $timestamp = mktime($hour, $minute, $second, $month, $day, $year);

Any idea how I could reverse this function? Thank you.
#2

[eluser]pistolPete[/eluser]
Have a look at the date() function: http://php.net/manual/en/function.date.php




Theme © iAndrew 2016 - Forum software by © MyBB