mirror of
https://github.com/friendica/friendica
synced 2025-04-25 13:10:11 +00:00
Change timestamp to be DateTime object not integers in Mastodon Timeline API
This commit is contained in:
parent
6ffd3a3f8c
commit
1adb23d8fd
2 changed files with 13 additions and 15 deletions
|
@ -156,12 +156,12 @@ class Status extends BaseDataTransferObject
|
|||
|
||||
/**
|
||||
* Returns the current created_at DateTime as an integer timestamp
|
||||
* @return int
|
||||
* @return \DateTime
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function createdAtTimestamp(): int
|
||||
public function createdAtTimestamp(): \DateTime
|
||||
{
|
||||
$result = strtotime($this->created_at);
|
||||
$result = new \DateTime($this->created_at);
|
||||
if (!$result) {
|
||||
throw new \Exception('Unknown date-time format');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue