$rawmode = (isset($_GET['mode']) AND ( $_GET['mode'] == 'raw'));
if (isset($_GET['last_received']) && isset($_GET['last_commented']) && isset($_GET['last_created']) && isset($_GET['last_id'])) {
- $last_received = DBM::date($_GET['last_received']);
- $last_commented = DBM::date($_GET['last_commented']);
- $last_created = DBM::date($_GET['last_created']);
+ $last_received = DateTimeFormat::utc($_GET['last_received']);
+ $last_commented = DateTimeFormat::utc($_GET['last_commented']);
+ $last_created = DateTimeFormat::utc($_GET['last_created']);
$last_id = intval($_GET['last_id']);
} else {
$last_received = '';
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
+use Friendica\Util\DateTimeFormat;
require_once 'boot.php';
require_once 'include/dba.php';
public static function update($verbose, $action, $install = false, array $tables = null, array $definition = null) {
if ($action && !$install) {
Config::set('system', 'maintenance', 1);
- Config::set('system', 'maintenance_reason', L10n::t('%s: Database update', DBM::date().' '.date('e')));
+ Config::set('system', 'maintenance_reason', L10n::t('%s: Database update', DateTimeFormat::utcNow().' '.date('e')));
}
$errors = '';
if ($action) {
if (!$install) {
- Config::set('system', 'maintenance_reason', L10n::t('%s: updating %s table.', DBM::date().' '.date('e'), $name));
+ Config::set('system', 'maintenance_reason', L10n::t('%s: updating %s table.', DateTimeFormat::utcNow().' '.date('e'), $name));
}
// Ensure index conversion to unique removes duplicates
use Friendica\Database\DBA;
use Friendica\Database\DBM;
+use Friendica\Util\DateTimeFormat;
require_once "include/dba.php";
*/
public static function insert($arr) {
if (in_array(defaults($arr, 'network', NETWORK_PHANTOM), [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && !empty($arr['uri'])) {
- $conversation = ['item-uri' => $arr['uri'], 'received' => DBM::date()];
+ $conversation = ['item-uri' => $arr['uri'], 'received' => DateTimeFormat::utcNow()];
if (isset($arr['parent-uri']) && ($arr['parent-uri'] != $arr['uri'])) {
$conversation['reply-to-uri'] = $arr['parent-uri'];
self::fixAlternateContactAddress($contact);
if (!isset($contact["updated"])) {
- $contact["updated"] = DBM::date();
+ $contact["updated"] = DateTimeFormat::utcNow();
}
if ($contact["network"] == NETWORK_TWITTER) {
logger("Update gcontact for ".$contact["url"], LOGGER_DEBUG);
$condition = ['`nurl` = ? AND (`generation` = 0 OR `generation` >= ?)',
normalise_link($contact["url"]), $contact["generation"]];
- $contact["updated"] = DBM::date($contact["updated"]);
+ $contact["updated"] = DateTimeFormat::utc($contact["updated"]);
$updated = ['photo' => $contact['photo'], 'name' => $contact['name'],
'nick' => $contact['nick'], 'addr' => $contact['addr'],
}
}
- $fields['updated'] = DBM::date();
+ $fields['updated'] = DateTimeFormat::utcNow();
$condition = ['nurl' => normalise_link($data["url"])];
dbesc($contact["name"]), dbesc($contact["nick"]), dbesc($contact["about"]), dbesc($contact["location"]),
dbesc($contact["addr"]), dbesc($contact["keywords"]), dbesc($contact["bdyear"]),
dbesc($contact["bd"]), intval($contact["hidden"]), dbesc($contact["xmpp"]),
- dbesc(DBM::date($contact["name-date"])), dbesc(DBM::date($contact["uri-date"])),
+ dbesc(DateTimeFormat::utc($contact["name-date"])), dbesc(DateTimeFormat::utc($contact["uri-date"])),
intval($contact["id"]), dbesc($contact["network"])
);
}
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\User;
+use Friendica\Util\DateTimeFormat;
require_once 'include/dba.php';
function update_1260() {
Config::set('system', 'maintenance', 1);
- Config::set('system', 'maintenance_reason', L10n::t('%s: Updating author-id and owner-id in item and thread table. ', DBM::date().' '.date('e')));
+ Config::set('system', 'maintenance_reason', L10n::t('%s: Updating author-id and owner-id in item and thread table. ', DateTimeFormat::utcNow().' '.date('e')));
$items = DBA::p("SELECT `id`, `owner-link`, `owner-name`, `owner-avatar`, `network` FROM `item`
WHERE `owner-id` = 0 AND `owner-link` != ''");
function update_1278() {
Config::set('system', 'maintenance', 1);
- Config::set('system', 'maintenance_reason', L10n::t('%s: Updating post-type.', DBM::date().' '.date('e')));
+ Config::set('system', 'maintenance_reason', L10n::t('%s: Updating post-type.', DateTimeFormat::utcNow().' '.date('e')));
Item::update(['post-type' => Item::PT_PAGE], ['bookmark' => true]);
Item::update(['post-type' => Item::PT_PERSONAL_NOTE], ['type' => 'note']);