Skip to content

Instantly share code, notes, and snippets.

@ashfame

ashfame/time.php Secret

Last active Aug 29, 2015
Embed
What would you like to do?
Timestamp of a time in a particular timezone
<?php
$datetimezone_object = new DateTimeZone('Pacific/Nauru'); // new DateTimeZone('PST');
$date = DateTime::createFromFormat( 'Y-m-d H:i:s', '2014-04-14 05:00:00', $datetimezone_object );
echo $date->getTimestamp();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment