Skip to content

Instantly share code, notes, and snippets.

@sharkpp
Created May 28, 2016 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharkpp/84deb455f9e1ffbc50f8cf1d5a0c399b to your computer and use it in GitHub Desktop.
Save sharkpp/84deb455f9e1ffbc50f8cf1d5a0c399b to your computer and use it in GitHub Desktop.
<?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