Lines Matching refs:timestamp
27 * @param integer|string|DateTime $timestamp Timestamp
33 function strftime (string $format, $timestamp = null, ?string $locale = null) : string { argument
34 if (!($timestamp instanceof DateTimeInterface)) {
35 $timestamp = is_int($timestamp) ? '@' . $timestamp : (string) $timestamp;
38 $timestamp = new DateTime($timestamp);
43 $timestamp->setTimezone(new DateTimeZone(date_default_timezone_get()));
59 '%e' => function ($timestamp) {
60 return sprintf('% 2u', $timestamp->format('j'));
62 '%j' => function ($timestamp) {
64 return sprintf('%03d', $timestamp->format('z')+1);
70 '%U' => function ($timestamp) {
72 $day = new DateTime(sprintf('%d-01 Sunday', $timestamp->format('Y')));
73 return sprintf('%02u', 1 + ($timestamp->format('z') - $day->format('z')) / 7);
76 '%W' => function ($timestamp) {
78 $day = new DateTime(sprintf('%d-01 Monday', $timestamp->format('Y')));
79 return sprintf('%02u', 1 + ($timestamp->format('z') - $day->format('z')) / 7);
89 '%C' => function ($timestamp) {
91 return floor($timestamp->format('Y') / 100);
93 '%g' => function ($timestamp) {
94 return substr($timestamp->format('o'), -2);
102 '%k' => function ($timestamp) {
103 return sprintf('% 2u', $timestamp->format('G'));
106 '%l' => function ($timestamp) {
107 return sprintf('% 2u', $timestamp->format('g'));
130 …ce_callback('/(?<!%)%([_#-]?)([a-zA-Z])/', function ($match) use ($translation_table, $timestamp) {
147 $result = $timestamp->format($replace);
149 $result = $replace($timestamp, $pattern);