note 127975 added to datetime.gettimestamp
| From: | UrielGonzalez at main dot php dot net | Date: | Fri, 02 Dec 2022 18:40:02 +0000 |
| Subject: | note 127975 added to datetime.gettimestamp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219931@lists.php.net to get a copy of this message | ||
Sometimes timestamp is required in miliseconds or microseconds, and as there's no flag for that
for method getTimestamp, then you could use Format instead.
Example:
(int)$now->format('Uv'); // Timestamp in miliseconds
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.161 (proxied: 2806:2f0:62a0:ce98:5107:380e:d58d:20d7)
----
Manual Page -- https://php.net/manual/en/datetime.gettimestamp.php
Edit -- https://main.php.net/note/edit/127975
Del: integrated -- https://main.php.net/note/delete/127975/integrated
Del: useless -- https://main.php.net/note/delete/127975/useless
Del: bad code -- https://main.php.net/note/delete/127975/bad+code
Del: spam -- https://main.php.net/note/delete/127975/spam
Del: non-english -- https://main.php.net/note/delete/127975/non-english
Del: in docs -- https://main.php.net/note/delete/127975/in+docs
Del: other reasons-- https://main.php.net/note/delete/127975
Reject -- https://main.php.net/note/reject/127975
Search -- https://main.php.net/manage/user-notes.php