Skip to content

Instantly share code, notes, and snippets.

@fightbulc fightbulc/app.php
Created Aug 18, 2015

Embed
What would you like to do?
moment test
<?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";
{
"require": {
"fightbulc/moment": "~1.7"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.