Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<?php
// The MIT License (MIT)
// Copyright (c) 2016 sharkpp.
// See: https://opensource.org/licenses/mit-license.php
ini_set('date.timezone', 'Asia/Tokyo');
$timestamp = isset($argv[1]) ? (int)$argv[1] : mktime(23, 45, 58, 2, 29, 2004);
// http://jp2.php.net/manual/ja/function.date.php
foreach ([
'd',
'D',
'j',
'l',
'N',
'S',
'w',
'z',
'W',
'F',
'm',
'M',
'n',
't',
'L',
'o',
'Y',
'y',
'a',
'A',
'B',
'g',
'G',
'h',
'H',
'i',
's',
'u',
'e',
'I',
'O',
'P',
'T',
'Z',
'c',
'r',
'U',
] as $fmt)
{
// $d = new DateTime($timestamp); echo $fmt . '@@' . $d->format($fmt) . '@~'; unset($d);
echo $fmt . '@@' . date($fmt, $timestamp) . '@~';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment