Created
August 18, 2015 18:29
-
-
Save fightbulc/54cb41121fe39c3d9756 to your computer and use it in GitHub Desktop.
moment test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
date_default_timezone_set('America/Chicago'); | |
// Using Moment -- https://github.com/fightbulc/moment.php | |
$m = new \Moment\Moment('now', 'CST'); | |
// Correct month 03 (March) | |
echo $m->format() . "\n"; | |
// Wrong month, says "April" | |
echo $m->format('l, dS F Y / H:i (e)') . "\n"; | |
// Using plain php date -- http://php.net/manual/en/function.date.php | |
// Correct month March | |
$date = date('l, dS F Y / H:i (e)'); | |
echo $date . "\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"fightbulc/moment": "~1.7" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment