1
0
Fork 0

Add Temporal::utcNow()

This commit is contained in:
Hypolite Petovan 2018-01-25 23:26:51 -05:00
commit 8aff8a76eb
51 changed files with 191 additions and 180 deletions

View file

@ -73,7 +73,7 @@ class ParseUrl
[
'url' => normalise_link($url), 'guessing' => !$no_guessing,
'oembed' => $do_oembed, 'content' => serialize($data),
'created' => Temporal::convert()
'created' => Temporal::utcNow()
],
true
);

View file

@ -123,6 +123,17 @@ class Temporal
]);
}
/**
* convert() shorthand for UTC now.
*
* @param string $format DateTime format string or Temporal constant
* @return string
*/
public static function utcNow($format = self::MYSQL)
{
return self::convert('now', 'UTC', 'UTC', $format);
}
/**
* @brief General purpose date parse/convert/format function.
*