$userContactCreated = $userContact['created'] ?? DBA::NULL_DATETIME;
$created = $userContactCreated < $publicContactCreated && ($userContactCreated != DBA::NULL_DATETIME) ? $userContactCreated : $publicContactCreated;
- $this->created_at = DateTimeFormat::utc($created, DateTimeFormat::ATOM);
+ $this->created_at = DateTimeFormat::utc($created, DateTimeFormat::API);
$this->note = BBCode::convert($publicContact['about'], false);
$this->url = $publicContact['url'];
{
$this->id = (string)$id;
$this->type = $type;
- $this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::ATOM);
+ $this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::API);
$this->account = $account->toArray();
if (!empty($status)) {
public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $reblog)
{
$this->id = (string)$item['uri-id'];
- $this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::ATOM);
+ $this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::API);
if ($item['gravity'] == GRAVITY_COMMENT) {
$this->in_reply_to_id = (string)$item['thr-parent-id'];
$this->access_token = $access_token;
$this->token_type = $token_type;
$this->scope = $scope;
- $this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::ATOM);
+ $this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::API);
}
}
*/
class DateTimeFormat
{
- const ATOM = 'Y-m-d\TH:i:s\Z';
+ const ATOM = 'Y-m-d\TH:i:s\Z';
const MYSQL = 'Y-m-d H:i:s';
- const HTTP = 'D, d M Y H:i:s \G\M\T';
+ const HTTP = 'D, d M Y H:i:s \G\M\T';
+ const API = 'Y-m-d\TH:i:s.000\Z';
/**
* convert() shorthand for UTC.