PHP basics – Date and time handling with time zones
So here it is, how to what I did with java, but with php. Fun stuff! date_default_timezone_set($timeZone); $epoch = mktime($hour, $min, $sec, $month, $day, $year); date_default_timezone_set($serverTimeZone); echo date(“Y-m-d H:i:s”,$epoch); mktime generates the epoch time for the date entered, you change the time zone back to the server and there you go, converted date time




Recent Comments