Add Temporal::utcNow()
This commit is contained in:
parent
38ff1b455b
commit
8aff8a76eb
51 changed files with 191 additions and 180 deletions
|
@ -460,7 +460,7 @@ function api_rss_extra(App $a, $arr, $user_info)
|
|||
'self' => System::baseUrl() . "/" . $a->query_string,
|
||||
'base' => System::baseUrl(),
|
||||
'updated' => api_date(null),
|
||||
'atom_updated' => Temporal::convert('now', 'UTC', 'UTC', Temporal::ATOM),
|
||||
'atom_updated' => Temporal::utcNow(Temporal::ATOM),
|
||||
'language' => $user_info['language'],
|
||||
'logo' => System::baseUrl() . "/images/friendica-32.png",
|
||||
];
|
||||
|
@ -4216,7 +4216,7 @@ function api_fr_photo_create_update($type)
|
|||
$result = q(
|
||||
"UPDATE `photo` SET %s, `edited`='%s' WHERE `uid` = %d AND `resource-id` = '%s' AND `album` = '%s'",
|
||||
$sql_extra,
|
||||
Temporal::convert(), // update edited timestamp
|
||||
Temporal::utcNow(), // update edited timestamp
|
||||
intval(api_user()),
|
||||
dbesc($photo_id),
|
||||
dbesc($album)
|
||||
|
@ -4420,7 +4420,7 @@ function api_account_update_profile_image($type)
|
|||
|
||||
q(
|
||||
"UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
||||
dbesc(Temporal::convert()),
|
||||
dbesc(Temporal::utcNow()),
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ class dba {
|
|||
|
||||
if ($log) {
|
||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||
@file_put_contents($a->config["system"]["db_log_index"], Temporal::convert()."\t".
|
||||
@file_put_contents($a->config["system"]["db_log_index"], Temporal::utcNow()."\t".
|
||||
$row['key']."\t".$row['rows']."\t".$row['Extra']."\t".
|
||||
basename($backtrace[1]["file"])."\t".
|
||||
$backtrace[1]["line"]."\t".$backtrace[2]["function"]."\t".
|
||||
|
@ -495,7 +495,7 @@ class dba {
|
|||
$duration = round($duration, 3);
|
||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||
|
||||
@file_put_contents($a->config["system"]["db_log"], Temporal::convert()."\t".$duration."\t".
|
||||
@file_put_contents($a->config["system"]["db_log"], Temporal::utcNow()."\t".$duration."\t".
|
||||
basename($backtrace[1]["file"])."\t".
|
||||
$backtrace[1]["line"]."\t".$backtrace[2]["function"]."\t".
|
||||
substr(self::replace_parameters($sql, $args), 0, 2000)."\n", FILE_APPEND);
|
||||
|
|
|
@ -451,7 +451,7 @@ function notification($params)
|
|||
$datarray['name_cache'] = strip_tags(bbcode($params['source_name']));
|
||||
$datarray['url'] = $params['source_link'];
|
||||
$datarray['photo'] = $params['source_photo'];
|
||||
$datarray['date'] = Temporal::convert();
|
||||
$datarray['date'] = Temporal::utcNow();
|
||||
$datarray['uid'] = $params['uid'];
|
||||
$datarray['link'] = $itemlink;
|
||||
$datarray['iid'] = $item_id;
|
||||
|
|
|
@ -240,8 +240,8 @@ function event_store($arr) {
|
|||
|
||||
$a = get_app();
|
||||
|
||||
$arr['created'] = (($arr['created']) ? $arr['created'] : Temporal::convert());
|
||||
$arr['edited'] = (($arr['edited']) ? $arr['edited'] : Temporal::convert());
|
||||
$arr['created'] = (($arr['created']) ? $arr['created'] : Temporal::utcNow());
|
||||
$arr['edited'] = (($arr['edited']) ? $arr['edited'] : Temporal::utcNow());
|
||||
$arr['type'] = (($arr['type']) ? $arr['type'] : 'event' );
|
||||
$arr['cid'] = ((intval($arr['cid'])) ? intval($arr['cid']) : 0);
|
||||
$arr['uri'] = (x($arr, 'uri') ? $arr['uri'] : item_new_uri($a->get_hostname(), $arr['uid']));
|
||||
|
|
|
@ -142,10 +142,10 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
|||
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] . '"');
|
||||
|
||||
if ($login_initial || $login_refresh) {
|
||||
dba::update('user', ['login_date' => Temporal::convert()], ['uid' => $_SESSION['uid']]);
|
||||
dba::update('user', ['login_date' => Temporal::utcNow()], ['uid' => $_SESSION['uid']]);
|
||||
|
||||
// Set the login date for all identities of the user
|
||||
dba::update('user', ['login_date' => Temporal::convert()],
|
||||
dba::update('user', ['login_date' => Temporal::utcNow()],
|
||||
['password' => $master_record['password'], 'email' => $master_record['email'], 'account_removed' => false]);
|
||||
}
|
||||
|
||||
|
|
|
@ -723,7 +723,7 @@ function logger($msg, $level = 0) {
|
|||
|
||||
$callers = debug_backtrace();
|
||||
$logline = sprintf("%s@%s\t[%s]:%s:%s:%s\t%s\n",
|
||||
Temporal::convert('now', 'UTC', 'UTC', Temporal::ATOM),
|
||||
Temporal::utcNow(Temporal::ATOM),
|
||||
$process_id,
|
||||
$LOGGER_LEVELS[$level],
|
||||
basename($callers[0]['file']),
|
||||
|
@ -789,7 +789,7 @@ function dlogger($msg, $level = 0) {
|
|||
|
||||
$callers = debug_backtrace();
|
||||
$logline = sprintf("%s@\t%s:\t%s:\t%s\t%s\t%s\n",
|
||||
Temporal::convert(),
|
||||
Temporal::utcNow(),
|
||||
$process_id,
|
||||
basename($callers[0]['file']),
|
||||
$callers[0]['line'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue