Re: echo strftime('%s'); returns -1, should be epoch time
| From: | Ashickur Rahman | Date: | Mon, 08 Jun 2020 23:06:38 +0000 |
| Subject: | Re: echo strftime('%s'); returns -1, should be epoch time | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327189@lists.php.net to get a copy of this message | ||
>
> php -r 'echo strftime("%s");'
>
works for me in terminal.
but
php -r "echo strftime('%s');”
>
is not working .
----------------------------------------------------------
Student, ইসলামী অর্থনীতি ও ফাইন্যান্স
কোর্স
<https://www.facebook.com/IEFCBD>
Secretary general, FOSS Bangladesh
2048R/89C932E1 <http://goo.gl/TkP5U>
+880-1752265811
On Mon, 8 Jun 2020 at 23:55, Pete Cooper <pete@pragmatika.net> wrote:
> Hello.
> I’m compiling PHP 7.4 and 7.3 from source on a self-managed Ubuntu 20.04
> server. I am encountering an issue with obtaining the epoch time.
>
> This is the command I am using:
>
> php -r "echo strftime('%s');”
>
> I expect the above to return epoch time (i.e. 1591628404 or thereabouts),
> but instead it returns -1.
>
> In my testing, running the above command on a vanilla Ubuntu LTS release
> with maintained
apt packages returns the expected result.
>
> I am scratching my head about the configuration/compile differences
> between the working and non-working instances. It’s not clear to me whether
> the issue is with PHP compile/config setup, or operating system locale
> differences, or something else entirely. I am grateful for any advice or
> feedback.
>
> Thank you for reading, and thank you for your time.
>
> --
> Pete Cooper
> pete@pragmatika.net
> https://pragmatika.net
>
> Please note: my working hours may not be your working hours. Please do
> not feel obligated to reply outside of your normal work schedule.
>
>