Question

suppose I have a certain date:

$date = mktime($hour, $minute, $second, $month, $day, $year);

this date is in local time, now how can I convert it to utc time and store the new hour, minute ... in php variables similar to $hour, $minute ...

Was it helpful?

Solution

You can get UTC time with gmdate: http://php.net/manual/en/function.gmdate.php

Also you can change your timezone to UTC: date_default_timezone_set('UTC');

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top