]> git.mxchange.org Git - friendica.git/commitdiff
Add Temporal::utcNow()
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 26 Jan 2018 04:26:51 +0000 (23:26 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 3 Feb 2018 13:56:52 +0000 (08:56 -0500)
51 files changed:
include/api.php
include/dba.php
include/enotify.php
include/event.php
include/security.php
include/text.php
mod/admin.php
mod/contacts.php
mod/dfrn_confirm.php
mod/dfrn_request.php
mod/fsuggest.php
mod/invite.php
mod/item.php
mod/lostpass.php
mod/network.php
mod/photos.php
mod/ping.php
mod/profile_photo.php
mod/profiles.php
mod/proxy.php
mod/pubsubhubbub.php
mod/register.php
mod/settings.php
mod/videos.php
mod/wall_attach.php
src/Content/OEmbed.php
src/Core/Cache.php
src/Core/Worker.php
src/Database/DBM.php
src/Model/Contact.php
src/Model/GContact.php
src/Model/Item.php
src/Model/Mail.php
src/Model/Photo.php
src/Model/Process.php
src/Model/Profile.php
src/Model/Queue.php
src/Model/User.php
src/Module/Login.php
src/Network/FKOAuth1.php
src/Protocol/DFRN.php
src/Protocol/Diaspora.php
src/Protocol/OStatus.php
src/Protocol/PortableContact.php
src/Util/ParseUrl.php
src/Util/Temporal.php
src/Worker/Cron.php
src/Worker/CronHooks.php
src/Worker/DiscoverPoCo.php
src/Worker/OnePoll.php
src/Worker/UpdateGContact.php

index 7044524a76d67702f0885231744c3f27f2449f1f..d20cd03dec98fa355dcb907104648a109aa725c2 100644 (file)
@@ -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())
        );
 
index e7a5db1afb3c04ed9027cd686ebe676304a596de..180748db961b77ceed972bcc1a8e2bc746e2885b 100644 (file)
@@ -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);
index 6b2f5e6ef97b685e29c0f6ede5dc34b0dcda0440..cf219676ecf4220b9bcb9079c6a837260847fda7 100644 (file)
@@ -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;
index 59ac8d4a2ca02ba08c5c54a6b18e42be613f433d..c69bd50e07eb821a03d2893fd00a3362cb213b18 100644 (file)
@@ -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']));
index 9b14ed3415a97eba37924ac4a44692b42aa4cfdb..e370e9340c30e4ebc7a50de3fc7c3fbf49cd6ba6 100644 (file)
@@ -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]);
        }
 
index def479ce337ffb50a3e929c663cd1eaf7bb6cc6d..6a48d7ef835bf0f100b56faad45851793415f87b 100644 (file)
@@ -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'],
index 9ce4f8d65dbcd9aaa3f220e50eb14b2d5083df27..9bd94cd03da8bd3c439714b5a11522325b3f059e 100644 (file)
@@ -740,7 +740,7 @@ function admin_page_summary(App $a)
        if (!$last_worker_call) {
                $showwarning = true;
                $warningtext[] = L10n::t('The worker was never executed. Please check your database structure!');
-       } elseif ((strtotime(Temporal::convert()) - strtotime($last_worker_call)) > 60 * 60) {
+       } elseif ((strtotime(Temporal::utcNow()) - strtotime($last_worker_call)) > 60 * 60) {
                $showwarning = true;
                $warningtext[] = L10n::t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.', $last_worker_call);
        }
index 43e6ae826d2d50a52d93729fde6bc1c58b40db66..6bd6f753ff6b5cf9d16a8e77262792993fff03f5 100644 (file)
@@ -554,7 +554,7 @@ function contacts_content(App $a)
                // tabs
                $tab_str = contacts_tab($a, $contact_id, 2);
 
-               $lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < datetime_convert('', '', 'now')) ? L10n::t('Communications lost with this contact!') : '');
+               $lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < Temporal::utcNow()) ? L10n::t('Communications lost with this contact!') : '');
 
                $fetch_further_information = null;
                if ($contact['network'] == NETWORK_FEED) {
index 95a928c373104f07b5080fc997a14ed9e0775abd..9a46d463b7f85a1efb9c6e17d946b0aa019de482 100644 (file)
@@ -327,8 +327,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                                `network` = '%s' WHERE `id` = %d
                        ",
                                intval($new_relation),
-                               dbesc(Temporal::convert()),
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
+                               dbesc(Temporal::utcNow()),
                                intval($duplex),
                                intval($hidden),
                                dbesc(NETWORK_DFRN),
@@ -378,8 +378,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                                `rel` = %d
                                WHERE `id` = %d
                        ",
-                               dbesc(Temporal::convert()),
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
+                               dbesc(Temporal::utcNow()),
                                dbesc($addr),
                                dbesc($notify),
                                dbesc($poll),
@@ -619,8 +619,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                        `network` = '%s' WHERE `id` = %d
                ",
                        intval($new_relation),
-                       dbesc(Temporal::convert()),
-                       dbesc(Temporal::convert()),
+                       dbesc(Temporal::utcNow()),
+                       dbesc(Temporal::utcNow()),
                        intval($duplex),
                        intval($forum),
                        intval($prv),
index 06b2e6b7783f89cd88bcc5e2656bd1034bba5ee0..161cd4b1bd7d14558a742e7c109d65b0672d84a6 100644 (file)
@@ -137,7 +137,7 @@ function dfrn_request_post(App $a)
                                                `request`, `confirm`, `notify`, `poll`, `poco`, `network`, `aes_allow`, `hidden`, `blocked`, `pending`)
                                                VALUES ( %d, '%s', '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d)",
                                                intval(local_user()),
-                                               Temporal::convert(),
+                                               Temporal::utcNow(),
                                                dbesc($dfrn_url),
                                                dbesc(normalise_link($dfrn_url)),
                                                $parms['addr'],
@@ -382,7 +382,7 @@ function dfrn_request_post(App $a)
                                        `request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
                                        VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
                                        intval($uid),
-                                       dbesc(Temporal::convert()),
+                                       dbesc(Temporal::utcNow()),
                                        $parms['url'],
                                        dbesc(normalise_link($url)),
                                        $parms['addr'],
@@ -430,7 +430,7 @@ function dfrn_request_post(App $a)
                                        ((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
                                        dbesc(notags(trim($_POST['dfrn-request-message']))),
                                        dbesc($hash),
-                                       dbesc(Temporal::convert())
+                                       dbesc(Temporal::utcNow())
                                );
                        }
 
index 92c41661f24fad78424435af4b21dd45ca12e69e..ccd38217d2ae095c113698a00752f37216d8a9ac 100644 (file)
@@ -52,7 +52,7 @@ function fsuggest_post(App $a)
                                dbesc($r[0]['request']),
                                dbesc($r[0]['photo']),
                                dbesc($hash),
-                               dbesc(Temporal::convert())
+                               dbesc(Temporal::utcNow())
                        );
                        $r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1",
                                dbesc($hash),
index 3b3b94c3d1a4cfa462b76bb10fe5dc573c376d4b..8ecbbe6cd828a330fded2df2501209efb1667b4b 100644 (file)
@@ -62,7 +62,7 @@ function invite_post(App $a)
 
                        $r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ",
                                dbesc($code),
-                               dbesc(Temporal::convert())
+                               dbesc(Temporal::utcNow())
                        );
 
                        if (! is_site_admin()) {
index 7a5a8aab48bdcc5a679312b6895d97567c76ca36..1b0010281695049a11c30f8069fa12cac1faaf4c 100644 (file)
@@ -601,11 +601,11 @@ function item_post(App $a) {
        $datarray['author-link']   = $author['url'];
        $datarray['author-avatar'] = $author['thumb'];
        $datarray['author-id']     = Contact::getIdForURL($datarray['author-link'], 0);
-       $datarray['created']       = Temporal::convert();
-       $datarray['edited']        = Temporal::convert();
-       $datarray['commented']     = Temporal::convert();
-       $datarray['received']      = Temporal::convert();
-       $datarray['changed']       = Temporal::convert();
+       $datarray['created']       = Temporal::utcNow();
+       $datarray['edited']        = Temporal::utcNow();
+       $datarray['commented']     = Temporal::utcNow();
+       $datarray['received']      = Temporal::utcNow();
+       $datarray['changed']       = Temporal::utcNow();
        $datarray['extid']         = $extid;
        $datarray['guid']          = $guid;
        $datarray['uri']           = $uri;
@@ -709,8 +709,8 @@ function item_post(App $a) {
                        'file' => $datarray['file'],
                        'rendered-html' => $datarray['rendered-html'],
                        'rendered-hash' => $datarray['rendered-hash'],
-                       'edited' => Temporal::convert(),
-                       'changed' => Temporal::convert()];
+                       'edited' => Temporal::utcNow(),
+                       'changed' => Temporal::utcNow()];
 
                Item::update($fields, ['id' => $post_id]);
 
index 87e492a92af30f118e2e411631dc56fbd7606be3..a34562de7ddcd123594f70dbec30e9270b187e63 100644 (file)
@@ -33,7 +33,7 @@ function lostpass_post(App $a)
 
        $fields = [
                'pwdreset' => $pwdreset_token,
-               'pwdreset_time' => Temporal::convert()
+               'pwdreset_time' => Temporal::utcNow()
        ];
        $result = dba::update('user', $fields, ['uid' => $user['uid']]);
        if ($result) {
index b5f58be40b024b9a5a76dd0ed89b1d5a4efefead..01b6413e6aa4d3aa793f531a0bfedd1dcedb0a57 100644 (file)
@@ -790,8 +790,8 @@ function networkThreadedView(App $a, $update = 0)
                        $top_limit = current($r)['order_date'];
                        $bottom_limit = end($r)['order_date'];
                } else {
-                       $top_limit = Temporal::convert();
-                       $bottom_limit = Temporal::convert();
+                       $top_limit = Temporal::utcNow();
+                       $bottom_limit = Temporal::utcNow();
                }
 
                // When checking for updates we need to fetch from the newest date to the newest date before
@@ -804,7 +804,7 @@ function networkThreadedView(App $a, $update = 0)
                        $top_limit = $last_date;
                } elseif ($a->pager['page'] == 1) {
                        // Highest possible top limit when we are on the first page
-                       $top_limit = Temporal::convert();
+                       $top_limit = Temporal::utcNow();
                }
 
                $items = dba::p("SELECT `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid` FROM `item`
index 2a1e7a4cdc99094ba87ab109842e1f49cb2fa013..a7ed50a44c29171ba25dab3d78078e7f1e0a239b 100644 (file)
@@ -291,7 +291,7 @@ function photos_post(App $a)
                        if (DBM::is_result($r)) {
                                foreach ($r as $rr) {
                                        q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
-                                               dbesc(Temporal::convert()),
+                                               dbesc(Temporal::utcNow()),
                                                dbesc($rr['parent-uri']),
                                                intval($page_owner_uid)
                                        );
@@ -364,8 +364,8 @@ function photos_post(App $a)
                        );
                        if (DBM::is_result($i)) {
                                q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
-                                       dbesc(Temporal::convert()),
-                                       dbesc(Temporal::convert()),
+                                       dbesc(Temporal::utcNow()),
+                                       dbesc(Temporal::utcNow()),
                                        dbesc($i[0]['uri']),
                                        intval($page_owner_uid)
                                );
@@ -649,8 +649,8 @@ function photos_post(App $a)
                        $r = q("UPDATE `item` SET `tag` = '%s', `inform` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d",
                                dbesc($newtag),
                                dbesc($newinform),
-                               dbesc(Temporal::convert()),
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
+                               dbesc(Temporal::utcNow()),
                                intval($item_id),
                                intval($page_owner_uid)
                        );
@@ -1361,7 +1361,7 @@ function photos_content(App $a)
                $photo = [
                        'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
                        'title'=> L10n::t('View Full Size'),
-                       'src'  => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . Temporal::convert('now', 'UTC', 'UTC', 'ymdhis'),
+                       'src'  => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . Temporal::utcNow('ymdhis'),
                        'height' => $hires['height'],
                        'width' => $hires['width'],
                        'album' => $hires['album'],
index 2bbe87254e53ac7065552b9738621e4802051d13..9d5a6c40962ee03a918c41a487729ad201697bab 100644 (file)
@@ -226,7 +226,7 @@ function ping_init(App $a)
                                ORDER BY `start` ASC ",
                                intval(local_user()),
                                dbesc(Temporal::convert('now + 7 days')),
-                               dbesc(Temporal::convert('now'))
+                               dbesc(Temporal::utcNow())
                        );
                        if (DBM::is_result($ev)) {
                                Cache::set($cachekey, $ev, CACHE_HOUR);
index 8c3c0de893cf49f3987713b74eec4eb4ac0a61bf..82050e962e07a011c4773f583081a03b3adc3907 100644 (file)
@@ -130,7 +130,7 @@ function profile_photo_post(App $a) {
                                // so that browsers will do a cache update unconditionally
 
                                $r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
-                                       dbesc(Temporal::convert()),
+                                       dbesc(Temporal::utcNow()),
                                        intval(local_user())
                                );
 
@@ -230,7 +230,7 @@ function profile_photo_content(App $a) {
                                );
 
                        $r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
                                intval(local_user())
                        );
 
index 5c4a14dd6becddd9f4b9d510faa7401e953c37a9..6206fdae3d7e06afdfcd5f17ba1b97db0054bc72 100644 (file)
@@ -487,7 +487,7 @@ function profiles_post(App $a) {
                if ($namechanged && $is_default) {
                        $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
                                dbesc($name),
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
                                intval(local_user())
                        );
                        $r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
index 244a6cae23958b1cf5c0dc84e1cfefd399bd4b26..332b5bd1b05e0512e8be26960f73c8dcac10d67b 100644 (file)
@@ -188,7 +188,7 @@ function proxy_init(App $a) {
                                die();
                        }
 
-                       $fields = ['uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => Temporal::convert(), 'edited' => Temporal::convert(),
+                       $fields = ['uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => Temporal::utcNow(), 'edited' => Temporal::utcNow(),
                                'filename' => basename($_REQUEST['url']), 'type' => '', 'album' => '', 'height' => imagesy($image), 'width' => imagesx($image),
                                'datasize' => 0, 'data' => $img_str, 'scale' => 100, 'profile' => 0,
                                'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', 'desc' => $mime];
index ffab754dee91bbdf228907ee921f9ac9d807b912..4dc163cbade2a2ba01edaf425ba83e4a8b99a3a1 100644 (file)
@@ -139,7 +139,7 @@ function pubsubhubbub_init(App $a) {
                  dbesc($hub_callback));
 
                if ($subscribe) {
-                       $last_update = Temporal::convert();
+                       $last_update = Temporal::utcNow();
                        $push_flag = 0;
 
                        // if we are just updating an old subscription, keep the
index f0ed5cd4a5bc8cf876175762961b62d424cb3074..07a20e318de76d13e733675089cb141227d855b5 100644 (file)
@@ -118,7 +118,7 @@ function register_post(App $a)
                $hash = random_string();
                $r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language`, `note` ) VALUES ( '%s', '%s', %d, '%s', '%s', '%s' ) ",
                        dbesc($hash),
-                       dbesc(Temporal::convert()),
+                       dbesc(Temporal::utcNow()),
                        intval($user['uid']),
                        dbesc($result['password']),
                        dbesc($lang),
index 3603008bf5e522b63558f465434769dca148fb30..5c220cb35ac08f091c7913f24c33328a22e3ab26 100644 (file)
@@ -631,7 +631,7 @@ function settings_post(App $a)
        if ($name_change) {
                q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self`",
                        dbesc($username),
-                       dbesc(Temporal::convert()),
+                       dbesc(Temporal::utcNow()),
                        intval(local_user())
                );
        }
index 00fa8859873efbdf3972ef2a6707f0c8fcd4e544..66ca2979fc28991474290635b236e1a2aa9a0691 100644 (file)
@@ -170,8 +170,8 @@ function videos_post(App $a) {
                        //echo "<pre>"; var_dump($i); killme();
                        if (DBM::is_result($i)) {
                                q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
-                                       dbesc(Temporal::convert()),
-                                       dbesc(Temporal::convert()),
+                                       dbesc(Temporal::utcNow()),
+                                       dbesc(Temporal::utcNow()),
                                        dbesc($i[0]['uri']),
                                        intval(local_user())
                                );
index 1ad435c45df19692305c74759ed709c98a8eac39..8cdee398e82f3e7499ab0d1d1df01c7c1a7ec3bd 100644 (file)
@@ -124,7 +124,7 @@ function wall_attach_post(App $a) {
        $filedata = @file_get_contents($src);
        $mimetype = Mimetype::getContentType($filename);
        $hash = get_guid(64);
-       $created = Temporal::convert();
+       $created = Temporal::utcNow();
 
        $fields = ['uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
                'filesize' => $filesize, 'data' => $filedata, 'created' => $created, 'edited' => $created,
index 4ff353fa9459fbf13ae7ba1ce1d08926ee27aea4..2a9db64882a2fa902948517bf808e99de2507bb1 100644 (file)
@@ -113,7 +113,7 @@ class OEmbed
                                                'url' => normalise_link($embedurl),
                                                'maxwidth' => $a->videowidth,
                                                'content' => $txt,
-                                               'created' => Temporal::convert()
+                                               'created' => Temporal::utcNow()
                                        ], true);
                                }
 
index c6368219a194dd548d66ad9b7db3a850a835f64a..f77319a46a741fb42412b19aa4bd59c28786cdb8 100644 (file)
@@ -147,7 +147,7 @@ class Cache
                        $memcache->set(get_app()->get_hostname().":".$key, serialize($value), MEMCACHE_COMPRESSED, self::duration($duration));
                        return;
                }
-               $fields = ['v' => serialize($value), 'expire_mode' => $duration, 'updated' => Temporal::convert()];
+               $fields = ['v' => serialize($value), 'expire_mode' => $duration, 'updated' => Temporal::utcNow()];
                $condition = ['k' => $key];
                dba::update('cache', $fields, $condition, true);
        }
index cb1877dbcc9eb989c43999afa8888bffab981e72..8ff37c01954de6e6b77614d2bc1df84d8feb932a 100644 (file)
@@ -235,7 +235,7 @@ class Worker
 
                        if ($age > 1) {
                                $stamp = (float)microtime(true);
-                               dba::update('workerqueue', ['executed' => Temporal::convert()], ['pid' => $mypid, 'done' => false]);
+                               dba::update('workerqueue', ['executed' => Temporal::utcNow()], ['pid' => $mypid, 'done' => false]);
                                self::$db_duration += (microtime(true) - $stamp);
                        }
 
@@ -245,7 +245,7 @@ class Worker
 
                        $stamp = (float)microtime(true);
                        if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
-                               Config::set('system', 'last_poller_execution', Temporal::convert());
+                               Config::set('system', 'last_poller_execution', Temporal::utcNow());
                        }
                        self::$db_duration = (microtime(true) - $stamp);
 
@@ -278,7 +278,7 @@ class Worker
 
                        if ($age > 1) {
                                $stamp = (float)microtime(true);
-                               dba::update('workerqueue', ['executed' => Temporal::convert()], ['pid' => $mypid, 'done' => false]);
+                               dba::update('workerqueue', ['executed' => Temporal::utcNow()], ['pid' => $mypid, 'done' => false]);
                                self::$db_duration += (microtime(true) - $stamp);
                        }
 
@@ -286,7 +286,7 @@ class Worker
 
                        $stamp = (float)microtime(true);
                        if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
-                               Config::set('system', 'last_poller_execution', Temporal::convert());
+                               Config::set('system', 'last_poller_execution', Temporal::utcNow());
                        }
                        self::$db_duration = (microtime(true) - $stamp);
                } else {
@@ -574,7 +574,7 @@ class Worker
                                        }
                                        dba::update(
                                                'workerqueue',
-                                               ['executed' => NULL_DATE, 'created' => Temporal::convert(), 'priority' => $new_priority, 'pid' => 0],
+                                               ['executed' => NULL_DATE, 'created' => Temporal::utcNow(), 'priority' => $new_priority, 'pid' => 0],
                                                ['id' => $entry["id"]]
                                        );
                                } else {
@@ -825,7 +825,7 @@ class Worker
                if ($found) {
                        $condition = "`id` IN (".substr(str_repeat("?, ", count($ids)), 0, -2).") AND `pid` = 0 AND NOT `done`";
                        array_unshift($ids, $condition);
-                       dba::update('workerqueue', ['executed' => Temporal::convert(), 'pid' => $mypid], $ids);
+                       dba::update('workerqueue', ['executed' => Temporal::utcNow(), 'pid' => $mypid], $ids);
                }
 
                return $found;
@@ -1040,7 +1040,7 @@ class Worker
 
                $priority = PRIORITY_MEDIUM;
                $dont_fork = Config::get("system", "worker_dont_fork");
-               $created = Temporal::convert();
+               $created = Temporal::utcNow();
 
                if (is_int($run_parameter)) {
                        $priority = $run_parameter;
index 8a57d04a60080f28cd0cf02e86f60759b48fb12a..ffe8785f10d70954d7965081d3ec3ce520715064 100644 (file)
@@ -126,6 +126,6 @@ class DBM
                        $timestamp = -62135596800;
                }
 
-               return date('Y-m-d H:i:s', (int)$timestamp);
+               return date(Temporal::MYSQL, (int)$timestamp);
        }
 }
index c3e154d7e8618fadd2e92145885cbe02e61f30c1..5afeebad4cd6cc94f0ebfef50f642926c79faf98 100644 (file)
@@ -112,7 +112,7 @@ class Contact extends BaseObject
 
                $return = dba::insert('contact', [
                        'uid'         => $user['uid'],
-                       'created'     => Temporal::convert(),
+                       'created'     => Temporal::utcNow(),
                        'self'        => 1,
                        'name'        => $user['username'],
                        'nick'        => $user['nickname'],
@@ -129,9 +129,9 @@ class Contact extends BaseObject
                        'poll'        => System::baseUrl() . '/dfrn_poll/'    . $user['nickname'],
                        'confirm'     => System::baseUrl() . '/dfrn_confirm/' . $user['nickname'],
                        'poco'        => System::baseUrl() . '/poco/'         . $user['nickname'],
-                       'name-date'   => Temporal::convert(),
-                       'uri-date'    => Temporal::convert(),
-                       'avatar-date' => Temporal::convert(),
+                       'name-date'   => Temporal::utcNow(),
+                       'uri-date'    => Temporal::utcNow(),
+                       'avatar-date' => Temporal::utcNow(),
                        'closeness'   => 0
                ]);
 
@@ -210,10 +210,10 @@ class Contact extends BaseObject
                }
 
                if ($contact['term-date'] <= NULL_DATE) {
-                       dba::update('contact', ['term-date' => Temporal::convert()], ['id' => $contact['id']]);
+                       dba::update('contact', ['term-date' => Temporal::utcNow()], ['id' => $contact['id']]);
 
                        if ($contact['url'] != '') {
-                               dba::update('contact', ['term-date' => Temporal::convert()], ['`nurl` = ? AND `term-date` <= ? AND NOT `self`', normalise_link($contact['url']), NULL_DATE]);
+                               dba::update('contact', ['term-date' => Temporal::utcNow()], ['`nurl` = ? AND `term-date` <= ? AND NOT `self`', normalise_link($contact['url']), NULL_DATE]);
                        }
                } else {
                        /* @todo
@@ -224,7 +224,7 @@ class Contact extends BaseObject
 
                        /// @todo Check for contact vitality via probing
                        $expiry = $contact['term-date'] . ' + 32 days ';
-                       if (Temporal::convert() > Temporal::convert($expiry)) {
+                       if (Temporal::utcNow() > Temporal::convert($expiry)) {
                                /* Relationship is really truly dead. archive them rather than
                                 * delete, though if the owner tries to unarchive them we'll start
                                 * the whole process over again.
@@ -728,7 +728,7 @@ class Contact extends BaseObject
                if (!$contact_id) {
                        dba::insert('contact', [
                                'uid'       => $uid,
-                               'created'   => Temporal::convert(),
+                               'created'   => Temporal::utcNow(),
                                'url'       => $data["url"],
                                'nurl'      => normalise_link($data["url"]),
                                'addr'      => $data["addr"],
@@ -749,9 +749,9 @@ class Contact extends BaseObject
                                'request'   => $data["request"],
                                'confirm'   => $data["confirm"],
                                'poco'      => $data["poco"],
-                               'name-date' => Temporal::convert(),
-                               'uri-date'  => Temporal::convert(),
-                               'avatar-date' => Temporal::convert(),
+                               'name-date' => Temporal::utcNow(),
+                               'uri-date'  => Temporal::utcNow(),
+                               'avatar-date' => Temporal::utcNow(),
                                'writable'  => 1,
                                'blocked'   => 0,
                                'readonly'  => 0,
@@ -823,13 +823,13 @@ class Contact extends BaseObject
                }
 
                if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) {
-                       $updated['uri-date'] = Temporal::convert();
+                       $updated['uri-date'] = Temporal::utcNow();
                }
                if (($data["name"] != $contact["name"]) || ($data["nick"] != $contact["nick"])) {
-                       $updated['name-date'] = Temporal::convert();
+                       $updated['name-date'] = Temporal::utcNow();
                }
 
-               $updated['avatar-date'] = Temporal::convert();
+               $updated['avatar-date'] = Temporal::utcNow();
 
                dba::update('contact', $updated, ['id' => $contact_id], $contact);
 
@@ -1026,7 +1026,7 @@ class Contact extends BaseObject
                        if ($photos) {
                                dba::update(
                                        'contact',
-                                       ['avatar' => $avatar, 'photo' => $photos[0], 'thumb' => $photos[1], 'micro' => $photos[2], 'avatar-date' => Temporal::convert()],
+                                       ['avatar' => $avatar, 'photo' => $photos[0], 'thumb' => $photos[1], 'micro' => $photos[2], 'avatar-date' => Temporal::utcNow()],
                                        ['id' => $cid]
                                );
 
@@ -1261,7 +1261,7 @@ class Contact extends BaseObject
                        // create contact record
                        dba::insert('contact', [
                                'uid'     => $uid,
-                               'created' => Temporal::convert(),
+                               'created' => Temporal::utcNow(),
                                'url'     => $ret['url'],
                                'nurl'    => normalise_link($ret['url']),
                                'addr'    => $ret['addr'],
@@ -1485,7 +1485,7 @@ class Contact extends BaseObject
                        foreach ($r as $rr) {
                                logger('update_contact_birthday: ' . $rr['bd']);
 
-                               $nextbd = Temporal::convert('now', 'UTC', 'UTC', 'Y') . substr($rr['bd'], 4);
+                               $nextbd = Temporal::convert('Y') . substr($rr['bd'], 4);
 
                                /*
                                 * Add new birthday event for this person
@@ -1508,7 +1508,7 @@ class Contact extends BaseObject
 
                                q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`)
                                VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ", intval($rr['uid']), intval($rr['id']),
-                                       dbesc(Temporal::convert()), dbesc(Temporal::convert()), dbesc(Temporal::convert($nextbd)),
+                                       dbesc(Temporal::utcNow()), dbesc(Temporal::utcNow()), dbesc(Temporal::convert($nextbd)),
                                        dbesc(Temporal::convert($nextbd . ' + 1 day ')), dbesc($bdtext), dbesc($bdtext2), dbesc('birthday'),
                                        intval(0)
                                );
index 1e0adac4940aa6d31d54b36d0b0783cf01a4506c..f588ec62b2daec6248320fb3c1f243b66f7ca915 100644 (file)
@@ -120,12 +120,12 @@ class GContact
                                intval($uid),
                                intval($gcid),
                                intval($zcid),
-                               dbesc(Temporal::convert())
+                               dbesc(Temporal::utcNow())
                        );
                } else {
                        q(
                                "UPDATE `glink` SET `updated` = '%s' WHERE `cid` = %d AND `uid` = %d AND `gcid` = %d AND `zcid` = %d",
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
                                intval($cid),
                                intval($uid),
                                intval($gcid),
@@ -717,8 +717,8 @@ class GContact
                                dbesc($contact["url"]),
                                dbesc(normalise_link($contact["url"])),
                                dbesc($contact["photo"]),
-                               dbesc(Temporal::convert()),
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
+                               dbesc(Temporal::utcNow()),
                                dbesc($contact["location"]),
                                dbesc($contact["about"]),
                                intval($contact["hide"]),
@@ -1050,7 +1050,7 @@ class GContact
 
                foreach ($r as $server) {
                        self::fetchGsUsers($server["url"]);
-                       q("UPDATE `gserver` SET `last_poco_query` = '%s' WHERE `nurl` = '%s'", dbesc(Temporal::convert()), dbesc($server["nurl"]));
+                       q("UPDATE `gserver` SET `last_poco_query` = '%s' WHERE `nurl` = '%s'", dbesc(Temporal::utcNow()), dbesc($server["nurl"]));
                }
        }
 
index 8628ac42d9950c963324c43bd7f651ad3d95db7e..62f19aeb5abfb90e3ae0f2a177b167458a906aec 100644 (file)
@@ -149,7 +149,7 @@ class Item extends BaseObject
 
                // Set the item to "deleted"
                dba::update('item', ['deleted' => true, 'title' => '', 'body' => '',
-                                       'edited' => Temporal::convert(), 'changed' => Temporal::convert()],
+                                       'edited' => Temporal::utcNow(), 'changed' => Temporal::utcNow()],
                                ['id' => $item['id']]);
 
                create_tags_from_item($item['id']);
index 701cf3ad956f7dbba3e27772fc3505ead448d8f0..41981fe9e2042bc804004a1f70deac0b3a338d84 100644 (file)
@@ -82,7 +82,7 @@ class Mail
                        $handles = $recip_handle . ';' . $sender_handle;
 
                        $fields = ['uid' => local_user(), 'guid' => $conv_guid, 'creator' => $sender_handle,
-                               'created' => Temporal::convert(), 'updated' => Temporal::convert(),
+                               'created' => Temporal::utcNow(), 'updated' => Temporal::utcNow(),
                                'subject' => $subject, 'recips' => $handles];
                        if (dba::insert('conv', $fields)) {
                                $convid = dba::lastInsertId();
@@ -116,7 +116,7 @@ class Mail
                                'replied' => 0,
                                'uri' => $uri,
                                'parent-uri' => $replyto,
-                               'created' => Temporal::convert()
+                               'created' => Temporal::utcNow()
                        ]
                );
 
@@ -196,7 +196,7 @@ class Mail
 
                $convid = null;
                $fields = ['uid' => $recipient['uid'], 'guid' => $conv_guid, 'creator' => $sender_handle,
-                       'created' => Temporal::convert(), 'updated' => Temporal::convert(),
+                       'created' => Temporal::utcNow(), 'updated' => Temporal::utcNow(),
                        'subject' => $subject, 'recips' => $handles];
                if (dba::insert('conv', $fields)) {
                        $convid = dba::lastInsertId();
@@ -224,7 +224,7 @@ class Mail
                                'replied' => 0,
                                'uri' => $uri,
                                'parent-uri' => $replyto,
-                               'created' => Temporal::convert(),
+                               'created' => Temporal::utcNow(),
                                'unknown' => 1
                        ]
                );
index a2c69f994c0f8444d96e9d505711d083c36bc9dd..a736c3638611c9f9bbf0d3795bf9535bedb6abf1 100644 (file)
@@ -55,8 +55,8 @@ class Photo
                        'contact-id' => $cid,
                        'guid' => $guid,
                        'resource-id' => $rid,
-                       'created' => Temporal::convert(),
-                       'edited' => Temporal::convert(),
+                       'created' => Temporal::utcNow(),
+                       'edited' => Temporal::utcNow(),
                        'filename' => basename($filename),
                        'type' => $Image->getType(),
                        'album' => $album,
index 99d5af543b4c255de66e16786a7fe2a429c0965a..5cb3369c66261e9dd4343dedb773157233158e4f 100644 (file)
@@ -34,7 +34,7 @@ class Process extends BaseObject
                dba::transaction();
 
                if (!dba::exists('process', ['pid' => $pid])) {
-                       $return = dba::insert('process', ['pid' => $pid, 'command' => $command, 'created' => Temporal::convert()]);
+                       $return = dba::insert('process', ['pid' => $pid, 'command' => $command, 'created' => Temporal::utcNow()]);
                }
 
                dba::commit();
index 665945032a837a3adb2d6c2c2cdeb991e6dfae77..bdc64a8ac24c7d97b92c76c78b8a121c073c5dcb 100644 (file)
@@ -557,7 +557,7 @@ class Profile
                                ORDER BY `start` ASC ",
                                local_user(),
                                Temporal::convert('now + 6 days'),
-                               Temporal::convert('now')
+                               Temporal::utcNow()
                        );
                        if (DBM::is_result($s)) {
                                $r = dba::inArray($s);
index 99ba6385c1680d783712ab749e01dd59fb180e23..6c49ff4d1a31bf6a02d396b7263558fbdcfe07dd 100644 (file)
@@ -20,7 +20,7 @@ class Queue
        public static function updateTime($id)
        {
                logger('queue: requeue item ' . $id);
-               dba::update('queue', ['last' => Temporal::convert()], ['id' => $id]);
+               dba::update('queue', ['last' => Temporal::utcNow()], ['id' => $id]);
        }
 
        /**
@@ -95,6 +95,6 @@ class Queue
                        }
                }
 
-               dba::insert('queue', ['cid' => $cid, 'network' => $network, 'created' => Temporal::convert(), 'last' => Temporal::convert(), 'content' => $msg, 'batch' =>($batch) ? 1 : 0]);
+               dba::insert('queue', ['cid' => $cid, 'network' => $network, 'created' => Temporal::utcNow(), 'last' => Temporal::utcNow(), 'content' => $msg, 'batch' =>($batch) ? 1 : 0]);
        }
 }
index 618c5988f1911ac29bd5accd54c797c200e6116f..3ef2a45955125b6a69c7f80fba8d41a8ab3abc21 100644 (file)
@@ -396,7 +396,7 @@ class User
                        'verified' => $verified,
                        'blocked'  => $blocked,
                        'timezone' => 'UTC',
-                       'register_date' => Temporal::convert(),
+                       'register_date' => Temporal::utcNow(),
                        'default-location' => ''
                ]);
 
@@ -613,7 +613,7 @@ class User
                dba::insert('userd', ['username' => $user['nickname']]);
 
                // The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php)
-               dba::update('user', ['account_removed' => true, 'account_expires_on' => Temporal::convert()], ['uid' => $uid]);
+               dba::update('user', ['account_removed' => true, 'account_expires_on' => Temporal::utcNow()], ['uid' => $uid]);
                Worker::add(PRIORITY_HIGH, "Notifier", "removeme", $uid);
 
                // Send an update to the directory
index 790fc3de8e08520d14de2623734c42e92841e997..e922094d6136450197229cca12f7b58a1336dc5d 100644 (file)
@@ -121,7 +121,7 @@ class Login extends BaseModule
 
                        // if we haven't failed up this point, log them in.
                        $_SESSION['remember'] = $_POST['remember'];
-                       $_SESSION['last_login_date'] = Temporal::convert();
+                       $_SESSION['last_login_date'] = Temporal::utcNow();
                        authenticate_success($record, true, true);
 
                        if (x($_SESSION, 'return_url')) {
@@ -220,10 +220,10 @@ class Login extends BaseModule
                                // stays logged in for a long time, e.g. with "Remember Me"
                                $login_refresh = false;
                                if (!x($_SESSION['last_login_date'])) {
-                                       $_SESSION['last_login_date'] = Temporal::convert();
+                                       $_SESSION['last_login_date'] = Temporal::utcNow();
                                }
                                if (strcmp(Temporal::convert('now - 12 hours'), $_SESSION['last_login_date']) > 0) {
-                                       $_SESSION['last_login_date'] = Temporal::convert();
+                                       $_SESSION['last_login_date'] = Temporal::utcNow();
                                        $login_refresh = true;
                                }
                                authenticate_success($user, false, false, $login_refresh);
index 7c8f56a64ad07ba0fec30266847c1f7eafdff230..f7f8f164173803456730e82323b80f07f97b9f90 100644 (file)
@@ -68,7 +68,7 @@ class FKOAuth1 extends OAuthServer
                        $_SESSION['cid'] = $a->cid;
                }
 
-               dba::update('user', ['login_date' => Temporal::convert()], ['uid' => $_SESSION['uid']]);
+               dba::update('user', ['login_date' => Temporal::utcNow()], ['uid' => $_SESSION['uid']]);
 
                Addon::callHooks('logged_in', $a->user);
        }
index 3145e21f2b933d14205b3aa0dad25eeef920c914..998a6022f356b02adb6a110e0a313151e7b56e4d 100644 (file)
@@ -1406,8 +1406,8 @@ class DFRN
                        VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
                        intval($contact["uid"]),
                        intval($contact["id"]),
-                       dbesc(Temporal::convert()),
-                       dbesc(Temporal::convert()),
+                       dbesc(Temporal::utcNow()),
+                       dbesc(Temporal::utcNow()),
                        dbesc(Temporal::convert($birthday)),
                        dbesc(Temporal::convert($birthday . " + 1 day ")),
                        dbesc($bdtext),
@@ -1889,7 +1889,7 @@ class DFRN
                        intval($suggest["cid"]),
                        dbesc($suggest["body"]),
                        dbesc($hash),
-                       dbesc(Temporal::convert()),
+                       dbesc(Temporal::utcNow()),
                        intval(0)
                );
 
@@ -2086,7 +2086,7 @@ class DFRN
                        }
 
                        $fields = ['title' => $item["title"], 'body' => $item["body"],
-                                       'tag' => $item["tag"], 'changed' => Temporal::convert(),
+                                       'tag' => $item["tag"], 'changed' => Temporal::utcNow(),
                                        'edited' => Temporal::convert($item["edited"])];
 
                        $condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
@@ -2836,7 +2836,7 @@ class DFRN
                                                `body` = '', `title` = ''
                                        WHERE `parent-uri` = '%s' AND `uid` IN (0, %d)",
                                        dbesc($when),
-                                       dbesc(Temporal::convert()),
+                                       dbesc(Temporal::utcNow()),
                                        dbesc($uri),
                                        intval($importer["uid"])
                                );
@@ -2849,7 +2849,7 @@ class DFRN
                                                `body` = '', `title` = ''
                                        WHERE `uri` = '%s' AND `uid` IN (0, %d)",
                                        dbesc($when),
-                                       dbesc(Temporal::convert()),
+                                       dbesc(Temporal::utcNow()),
                                        dbesc($uri),
                                        intval($importer["uid"])
                                );
index db18fbb47866b9d2bbc6679484312598a1625b5f..afd7359650d7b93c3983c9e12d319d9630f7beb2 100644 (file)
@@ -77,7 +77,7 @@ class Diaspora
                                $r = q(
                                        "INSERT INTO `contact` (`uid`, `created`, `name`, `nick`, `addr`, `url`, `nurl`, `batch`, `network`, `rel`, `blocked`, `pending`, `writable`, `name-date`, `uri-date`, `avatar-date`)
                                        VALUES (0, '%s', '%s', 'relay', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 1, '%s', '%s', '%s')",
-                                       Temporal::convert(),
+                                       Temporal::utcNow(),
                                        dbesc($addr),
                                        dbesc($addr),
                                        dbesc($server),
@@ -85,9 +85,9 @@ class Diaspora
                                        dbesc($batch),
                                        dbesc(NETWORK_DIASPORA),
                                        intval(CONTACT_IS_FOLLOWER),
-                                       dbesc(Temporal::convert()),
-                                       dbesc(Temporal::convert()),
-                                       dbesc(Temporal::convert())
+                                       dbesc(Temporal::utcNow()),
+                                       dbesc(Temporal::utcNow()),
+                                       dbesc(Temporal::utcNow())
                                );
 
                                $relais = q("SELECT `batch`, `id`, `name`,`network` FROM `contact` WHERE `uid` = 0 AND `batch` = '%s' LIMIT 1", dbesc($batch));
@@ -871,7 +871,7 @@ class Diaspora
                                dbesc($arr["confirm"]),
                                dbesc($arr["alias"]),
                                dbesc($arr["pubkey"]),
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
                                dbesc($arr["url"]),
                                dbesc($arr["network"])
                        );
@@ -894,7 +894,7 @@ class Diaspora
                                dbesc($arr["network"]),
                                dbesc($arr["alias"]),
                                dbesc($arr["pubkey"]),
-                               dbesc(Temporal::convert())
+                               dbesc(Temporal::utcNow())
                        );
                }
 
@@ -1656,7 +1656,7 @@ class Diaspora
                if (isset($data->created_at)) {
                        $created_at = Temporal::convert(notags(unxmlify($data->created_at)));
                } else {
-                       $created_at = Temporal::convert();
+                       $created_at = Temporal::utcNow();
                }
 
                if (isset($data->thread_parent_guid)) {
@@ -1831,7 +1831,7 @@ class Diaspora
 
                dba::unlock();
 
-               dba::update('conv', ['updated' => Temporal::convert()], ['id' => $conversation["id"]]);
+               dba::update('conv', ['updated' => Temporal::utcNow()], ['id' => $conversation["id"]]);
 
                notification(
                        [
@@ -1897,7 +1897,7 @@ class Diaspora
                                dbesc($guid),
                                dbesc($author),
                                dbesc($created_at),
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
                                dbesc($subject),
                                dbesc($participants)
                        );
@@ -2164,7 +2164,7 @@ class Diaspora
 
                dba::unlock();
 
-               dba::update('conv', ['updated' => Temporal::convert()], ['id' => $conversation["id"]]);
+               dba::update('conv', ['updated' => Temporal::utcNow()], ['id' => $conversation["id"]]);
                return true;
        }
 
@@ -2331,7 +2331,7 @@ class Diaspora
                        dbesc($name),
                        dbesc($nick),
                        dbesc($author),
-                       dbesc(Temporal::convert()),
+                       dbesc(Temporal::utcNow()),
                        dbesc($birthday),
                        dbesc($location),
                        dbesc($about),
@@ -2537,7 +2537,7 @@ class Diaspora
                        intval($importer["uid"]),
                        dbesc($ret["network"]),
                        dbesc($ret["addr"]),
-                       Temporal::convert(),
+                       Temporal::utcNow(),
                        dbesc($ret["url"]),
                        dbesc(normalise_link($ret["url"])),
                        dbesc($batch),
@@ -2580,7 +2580,7 @@ class Diaspora
                                0,
                                dbesc(L10n::t("Sharing notification from Diaspora network")),
                                dbesc($hash),
-                               dbesc(Temporal::convert())
+                               dbesc(Temporal::utcNow())
                        );
                } else {
                        // automatic friend approval
@@ -2611,8 +2611,8 @@ class Diaspora
                                WHERE `id` = %d
                                ",
                                intval($new_relation),
-                               dbesc(Temporal::convert()),
-                               dbesc(Temporal::convert()),
+                               dbesc(Temporal::utcNow()),
+                               dbesc(Temporal::utcNow()),
                                intval($contact_record["id"])
                        );
 
@@ -2852,8 +2852,8 @@ class Diaspora
                                        'deleted' => true,
                                        'title' => '',
                                        'body' => '',
-                                       'edited' => Temporal::convert(),
-                                       'changed' => Temporal::convert()],
+                                       'edited' => Temporal::utcNow(),
+                                       'changed' => Temporal::utcNow()],
                                ['id' => $item["id"]]
                        );
 
index b3c85f377e2de1be105924b14af0813b0a255e54..c98b8ddec023025739762edf34a7ecfba3f737d3 100644 (file)
@@ -199,7 +199,7 @@ class OStatus
                                $contact["location"] = $value;
                        }
 
-                       $contact['name-date'] = Temporal::convert();
+                       $contact['name-date'] = Temporal::utcNow();
 
                        dba::update('contact', $contact, ['id' => $contact["id"]], $current);
 
@@ -220,7 +220,7 @@ class OStatus
                                                'nurl' => normalise_link($author["author-link"]),
                                                'nick' => $contact["nick"], 'alias' => $contact["alias"],
                                                'about' => $contact["about"], 'location' => $contact["location"],
-                                               'success_update' => Temporal::convert(), 'last-update' => Temporal::convert()];
+                                               'success_update' => Temporal::utcNow(), 'last-update' => Temporal::utcNow()];
 
                                dba::update('contact', $fields, ['id' => $cid], $old_contact);
 
@@ -558,7 +558,7 @@ class OStatus
                dba::update(
                        'item',
                        ['deleted' => true, 'title' => '', 'body' => '',
-                                       'edited' => Temporal::convert(), 'changed' => Temporal::convert()],
+                                       'edited' => Temporal::utcNow(), 'changed' => Temporal::utcNow()],
                        ['id' => $deleted["id"]]
                );
 
index 04497f16bac072a034f07ce01aba5c7132937874..aea68eb998e9bd9043e528f0bc516c1fefe8d45c 100644 (file)
@@ -315,7 +315,7 @@ class PortableContact
                $contact = ["url" => $profile];
 
                if ($gcontacts[0]["created"] <= NULL_DATE) {
-                       $contact['created'] = Temporal::convert();
+                       $contact['created'] = Temporal::utcNow();
                }
 
                if ($force) {
@@ -338,7 +338,7 @@ class PortableContact
                if ($server_url != "") {
                        if (!self::checkServer($server_url, $gcontacts[0]["network"], $force)) {
                                if ($force) {
-                                       $fields = ['last_failure' => Temporal::convert()];
+                                       $fields = ['last_failure' => Temporal::utcNow()];
                                        dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
                                }
 
@@ -412,14 +412,14 @@ class PortableContact
 
                                                // Set the date of the last contact
                                                /// @todo By now the function "update_gcontact" doesn't work with this field
-                                               //$contact["last_contact"] = Temporal::convert();
+                                               //$contact["last_contact"] = Temporal::utcNow();
 
                                                $contact = array_merge($contact, $noscrape);
 
                                                GContact::update($contact);
 
                                                if (trim($noscrape["updated"]) != "") {
-                                                       $fields = ['last_contact' => Temporal::convert()];
+                                                       $fields = ['last_contact' => Temporal::utcNow()];
                                                        dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
 
                                                        logger("Profile ".$profile." was last updated at ".$noscrape["updated"]." (noscrape)", LOGGER_DEBUG);
@@ -468,7 +468,7 @@ class PortableContact
                }
 
                if (($data["poll"] == "") || (in_array($data["network"], [NETWORK_FEED, NETWORK_PHANTOM]))) {
-                       $fields = ['last_failure' => Temporal::convert()];
+                       $fields = ['last_failure' => Temporal::utcNow()];
                        dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
 
                        logger("Profile ".$profile." wasn't reachable (profile)", LOGGER_DEBUG);
@@ -484,7 +484,7 @@ class PortableContact
                $feedret = Network::curl($data["poll"]);
 
                if (!$feedret["success"]) {
-                       $fields = ['last_failure' => Temporal::convert()];
+                       $fields = ['last_failure' => Temporal::utcNow()];
                        dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
 
                        logger("Profile ".$profile." wasn't reachable (no feed)", LOGGER_DEBUG);
@@ -533,7 +533,7 @@ class PortableContact
 
        public static function updateNeeded($created, $updated, $last_failure, $last_contact)
        {
-               $now = strtotime(Temporal::convert());
+               $now = strtotime(Temporal::utcNow());
 
                if ($updated > $last_contact) {
                        $contact_time = strtotime($updated);
@@ -922,7 +922,7 @@ class PortableContact
                $gserver = dba::selectFirst('gserver', [], ['nurl' => normalise_link($server_url)]);
                if (DBM::is_result($gserver)) {
                        if ($gserver["created"] <= NULL_DATE) {
-                               $fields = ['created' => Temporal::convert()];
+                               $fields = ['created' => Temporal::utcNow()];
                                $condition = ['nurl' => normalise_link($server_url)];
                                dba::update('gserver', $fields, $condition);
                        }
@@ -969,7 +969,7 @@ class PortableContact
                // Mastodon uses the "@" for user profiles.
                // But this can be misunderstood.
                if (parse_url($server_url, PHP_URL_USER) != '') {
-                       dba::update('gserver', ['last_failure' => Temporal::convert()], ['nurl' => normalise_link($server_url)]);
+                       dba::update('gserver', ['last_failure' => Temporal::utcNow()], ['nurl' => normalise_link($server_url)]);
                        return false;
                }
 
@@ -985,7 +985,7 @@ class PortableContact
                if (DBM::is_result($gserver) && ($orig_server_url == $server_url) &&
                        ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
                        logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
-                       dba::update('gserver', ['last_failure' => Temporal::convert()], ['nurl' => normalise_link($server_url)]);
+                       dba::update('gserver', ['last_failure' => Temporal::utcNow()], ['nurl' => normalise_link($server_url)]);
                        return false;
                }
 
@@ -1000,7 +1000,7 @@ class PortableContact
                        // Quit if there is a timeout
                        if ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT) {
                                logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
-                               dba::update('gserver', ['last_failure' => Temporal::convert()], ['nurl' => normalise_link($server_url)]);
+                               dba::update('gserver', ['last_failure' => Temporal::utcNow()], ['nurl' => normalise_link($server_url)]);
                                return false;
                        }
 
@@ -1332,9 +1332,9 @@ class PortableContact
 
                if ($failure) {
                        $last_contact = $orig_last_contact;
-                       $last_failure = Temporal::convert();
+                       $last_failure = Temporal::utcNow();
                } else {
-                       $last_contact = Temporal::convert();
+                       $last_contact = Temporal::utcNow();
                        $last_failure = $orig_last_failure;
                }
 
@@ -1362,7 +1362,7 @@ class PortableContact
                        dba::update('gserver', $fields, ['nurl' => normalise_link($server_url)]);
                } elseif (!$failure) {
                        $fields['nurl'] = normalise_link($server_url);
-                       $fields['created'] = Temporal::convert();
+                       $fields['created'] = Temporal::utcNow();
                        dba::insert('gserver', $fields);
                }
                logger("End discovery for server " . $server_url, LOGGER_DEBUG);
@@ -1526,7 +1526,7 @@ class PortableContact
                                }
                        }
 
-                       $fields = ['last_poco_query' => Temporal::convert()];
+                       $fields = ['last_poco_query' => Temporal::utcNow()];
                        dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
 
                        return true;
@@ -1535,7 +1535,7 @@ class PortableContact
                        self::checkServer($server["url"], $server["network"], true);
 
                        // If we couldn't reach the server, we will try it some time later
-                       $fields = ['last_poco_query' => Temporal::convert()];
+                       $fields = ['last_poco_query' => Temporal::utcNow()];
                        dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
 
                        return false;
@@ -1561,7 +1561,7 @@ class PortableContact
                        foreach ($r as $server) {
                                if (!self::checkServer($server["url"], $server["network"])) {
                                        // The server is not reachable? Okay, then we will try it later
-                                       $fields = ['last_poco_query' => Temporal::convert()];
+                                       $fields = ['last_poco_query' => Temporal::utcNow()];
                                        dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
                                        continue;
                                }
index 23e24b12354f54ef2a96d517a2e39c6add31b24f..3074e74dd6659cd41ef0a5e417607db56c80db36 100644 (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
                );
index 176e616477baf4734ca5498dabad08aa55767b2e..eb0bbeb8e0e0cd0b36d33cecbec2373c35b89470 100644 (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.
         *
index 0b497f6f170015d0379090e63b824b0f1723316d..07ddf8bee4fa6377916d2d608b45b35c1b649d97 100644 (file)
@@ -71,7 +71,7 @@ Class Cron {
 
                // once daily run birthday_updates and then expire in background
                $d1 = Config::get('system', 'last_expire_day');
-               $d2 = intval(Temporal::convert('now', 'UTC', 'UTC', 'd'));
+               $d2 = intval(Temporal::utcNow('d'));
 
                if ($d2 != intval($d1)) {
 
@@ -142,7 +142,7 @@ Class Cron {
 
                Addon::reload();
 
-               $d = Temporal::convert();
+               $d = Temporal::utcNow();
 
                // Only poll from those with suitable relationships,
                // and which have a polling address and ignore Diaspora since
@@ -218,33 +218,33 @@ Class Cron {
                                 */
                                switch ($contact['priority']) {
                                        case 5:
-                                               if (Temporal::convert('now') > Temporal::convert($t . " + 1 month")) {
+                                               if (Temporal::utcNow() > Temporal::convert($t . " + 1 month")) {
                                                        $update = true;
                                                }
                                                break;
                                        case 4:
-                                               if (Temporal::convert('now') > Temporal::convert($t . " + 1 week")) {
+                                               if (Temporal::utcNow() > Temporal::convert($t . " + 1 week")) {
                                                        $update = true;
                                                }
                                                break;
                                        case 3:
-                                               if (Temporal::convert('now') > Temporal::convert($t . " + 1 day")) {
+                                               if (Temporal::utcNow() > Temporal::convert($t . " + 1 day")) {
                                                        $update = true;
                                                }
                                                break;
                                        case 2:
-                                               if (Temporal::convert('now') > Temporal::convert($t . " + 12 hour")) {
+                                               if (Temporal::utcNow() > Temporal::convert($t . " + 12 hour")) {
                                                        $update = true;
                                                }
                                                break;
                                        case 1:
-                                               if (Temporal::convert('now') > Temporal::convert($t . " + 1 hour")) {
+                                               if (Temporal::utcNow() > Temporal::convert($t . " + 1 hour")) {
                                                        $update = true;
                                                }
                                                break;
                                        case 0:
                                        default:
-                                               if (Temporal::convert('now') > Temporal::convert($t . " + ".$min_poll_interval." minute")) {
+                                               if (Temporal::utcNow() > Temporal::convert($t . " + ".$min_poll_interval." minute")) {
                                                        $update = true;
                                                }
                                                break;
index 7aaf2567fc033ca3dc1dda435bf5d1d418e0628a..d8b97384e6434f1f14d44783cd5d87c9c9e389a4 100644 (file)
@@ -45,7 +45,7 @@ Class CronHooks {
 
                logger('cronhooks: start');
 
-               $d = Temporal::convert();
+               $d = Temporal::utcNow();
 
                if (is_array($a->hooks) && array_key_exists("cron", $a->hooks)) {
                        foreach ($a->hooks["cron"] as $hook) {
index 5bcff6d1a73b3ab53b44443e2d444b3641c3ad80..480578c8f9660549adc3068944adb2a89c09c572 100644 (file)
@@ -198,7 +198,7 @@ class DiscoverPoCo {
                                }
                        } else {
                                q("UPDATE `gcontact` SET `last_failure` = '%s' WHERE `nurl` = '%s'",
-                                       dbesc(Temporal::convert()), dbesc(normalise_link($user["url"])));
+                                       dbesc(Temporal::utcNow()), dbesc(normalise_link($user["url"])));
                        }
 
                        // Quit the loop after 3 minutes
index ff08ed09432cd487f88a26fb195196d06583f8af..6e69bc3aa8570e1519bf63a50fbfb53f636b5066 100644 (file)
@@ -44,7 +44,7 @@ class OnePoll
                        return;
                }
 
-               $d = Temporal::convert();
+               $d = Temporal::utcNow();
 
                $contact = dba::selectFirst('contact', [], ['id' => $contact_id]);
                if (!DBM::is_result($contact)) {
@@ -70,7 +70,7 @@ class OnePoll
                // Diaspora users, archived users and followers are only checked if they still exist.
                if ($contact['archive'] || ($contact["network"] == NETWORK_DIASPORA) || ($contact["rel"] == CONTACT_IS_FOLLOWER)) {
                        $last_updated = PortableContact::lastUpdated($contact["url"], true);
-                       $updated = Temporal::convert();
+                       $updated = Temporal::utcNow();
                        if ($last_updated) {
                                logger('Contact '.$contact['id'].' had last update on '.$last_updated, LOGGER_DEBUG);
 
@@ -99,7 +99,7 @@ class OnePoll
                        $contact['priority'] = intval($poll_interval);
                        $hub_update = false;
 
-                       if (Temporal::convert('now') > Temporal::convert($t . " + 1 day")) {
+                       if (Temporal::utcNow() > Temporal::convert($t . " + 1 day")) {
                                $hub_update = true;
                        }
                } else {
@@ -117,7 +117,7 @@ class OnePoll
                                logger("Skipping probably dead contact ".$contact['url']);
 
                                // set the last-update so we don't keep polling
-                               dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                               dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                                return;
                        }
 
@@ -126,7 +126,7 @@ class OnePoll
                                logger('Contact is marked dead');
 
                                // set the last-update so we don't keep polling
-                               dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                               dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                                return;
                        } else {
                                Contact::unmarkForArchival($contact);
@@ -137,7 +137,7 @@ class OnePoll
                        logger('Ignore public contacts');
 
                        // set the last-update so we don't keep polling
-                       dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                       dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                        return;
                }
 
@@ -149,7 +149,7 @@ class OnePoll
                        logger('No self contact for user '.$importer_uid);
 
                        // set the last-update so we don't keep polling
-                       dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                       dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                        return;
                }
 
@@ -185,7 +185,7 @@ class OnePoll
 
                        if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
                                // set the last-update so we don't keep polling
-                               dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                               dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                                Contact::markForArchival($contact);
                                return;
                        }
@@ -207,7 +207,7 @@ class OnePoll
                                Contact::markForArchival($contact);
 
                                // set the last-update so we don't keep polling
-                               $fields = ['last-update' => Temporal::convert(), 'failure_update' => Temporal::convert()];
+                               $fields = ['last-update' => Temporal::utcNow(), 'failure_update' => Temporal::utcNow()];
                                self::updateContact($contact, $fields);
                                return;
                        }
@@ -217,7 +217,7 @@ class OnePoll
 
                                Contact::markForArchival($contact);
 
-                               $fields = ['last-update' => Temporal::convert(), 'failure_update' => Temporal::convert()];
+                               $fields = ['last-update' => Temporal::utcNow(), 'failure_update' => Temporal::utcNow()];
                                self::updateContact($contact, $fields);
                                return;
                        }
@@ -230,7 +230,7 @@ class OnePoll
 
                                // we may not be friends anymore. Will keep trying for one month.
                                // set the last-update so we don't keep polling
-                               $fields = ['last-update' => Temporal::convert(), 'failure_update' => Temporal::convert()];
+                               $fields = ['last-update' => Temporal::utcNow(), 'failure_update' => Temporal::utcNow()];
                                self::updateContact($contact, $fields);
 
                                Contact::markForArchival($contact);
@@ -241,7 +241,7 @@ class OnePoll
 
                        if ((intval($res->status) != 0) || !strlen($res->challenge) || !strlen($res->dfrn_id)) {
                                // set the last-update so we don't keep polling
-                               dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                               dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                                return;
                        }
 
@@ -276,7 +276,7 @@ class OnePoll
                                logger('ID did not decode: ' . $contact['id'] . ' orig: ' . $orig_id . ' final: ' . $final_dfrn_id);
 
                                // set the last-update so we don't keep polling
-                               dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                               dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                                Contact::markForArchival($contact);
                                return;
                        }
@@ -311,7 +311,7 @@ class OnePoll
 
                        if ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly']) {
                                // set the last-update so we don't keep polling
-                               dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                               dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                                return;
                        }
 
@@ -321,7 +321,7 @@ class OnePoll
 
                        if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
                                // set the last-update so we don't keep polling
-                               dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                               dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                                Contact::markForArchival($contact);
                                return;
                        }
@@ -335,7 +335,7 @@ class OnePoll
                        $mail_disabled = ((function_exists('imap_open') && (! Config::get('system', 'imap_disabled'))) ? 0 : 1);
                        if ($mail_disabled) {
                                // set the last-update so we don't keep polling
-                               dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
+                               dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
                                Contact::markForArchival($contact);
                                return;
                        }
@@ -355,7 +355,7 @@ class OnePoll
                                unset($password);
                                logger("Mail: Connect to " . $mailconf['user']);
                                if ($mbox) {
-                                       $fields = ['last_check' => Temporal::convert()];
+                                       $fields = ['last_check' => Temporal::utcNow()];
                                        dba::update('mailacct', $fields, ['id' => $mailconf['id']]);
                                        logger("Mail: Connected to " . $mailconf['user']);
                                } else {
@@ -395,7 +395,7 @@ class OnePoll
                                                                // Only delete when mails aren't automatically moved or deleted
                                                                if (($mailconf['action'] != 1) && ($mailconf['action'] != 3))
                                                                        if ($meta->deleted && ! $item['deleted']) {
-                                                                               $fields = ['deleted' => true, 'changed' => Temporal::convert()];
+                                                                               $fields = ['deleted' => true, 'changed' => Temporal::utcNow()];
                                                                                dba::update('item', $fields, ['id' => $item['id']]);
                                                                        }
 
@@ -572,7 +572,7 @@ class OnePoll
                        if (!strstr($xml, '<')) {
                                logger('post_handshake: response from ' . $url . ' did not contain XML.');
 
-                               $fields = ['last-update' => Temporal::convert(), 'failure_update' => Temporal::convert()];
+                               $fields = ['last-update' => Temporal::utcNow(), 'failure_update' => Temporal::utcNow()];
                                self::updateContact($contact, $fields);
                                Contact::markForArchival($contact);
                                return;
@@ -616,19 +616,19 @@ class OnePoll
                                }
                        }
 
-                       $updated = Temporal::convert();
+                       $updated = Temporal::utcNow();
 
                        self::updateContact($contact, ['last-update' => $updated, 'success_update' => $updated]);
                        dba::update('gcontact', ['last_contact' => $updated], ['nurl' => $contact['nurl']]);
                        Contact::unmarkForArchival($contact);
                } elseif (in_array($contact["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_FEED])) {
-                       $updated = Temporal::convert();
+                       $updated = Temporal::utcNow();
 
                        self::updateContact($contact, ['last-update' => $updated, 'failure_update' => $updated]);
                        dba::update('gcontact', ['last_failure' => $updated], ['nurl' => $contact['nurl']]);
                        Contact::markForArchival($contact);
                } else {
-                       $updated = Temporal::convert();
+                       $updated = Temporal::utcNow();
                        dba::update('contact', ['last-update' => $updated], ['id' => $contact['id']]);
                }
 
index 520dfed3b389ef8fd4d89dad71387f1559bafca6..da307b4fafebc16c10b8fc626b5539141ee0c9fc 100644 (file)
@@ -42,7 +42,7 @@ class UpdateGContact
                        }
 
                        q("UPDATE `gcontact` SET `last_failure` = '%s' WHERE `id` = %d",
-                               dbesc(Temporal::convert()), intval($contact_id));
+                               dbesc(Temporal::utcNow()), intval($contact_id));
                        return;
                }