php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77891 Epoch time function strftime('%s') call returns empty on Windows but works on L
Submitted: 2019-04-14 10:14 UTC Modified: 2019-04-14 10:25 UTC
From: phpbugreport at mailinator dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 7.3.4 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpbugreport at mailinator dot com
New email:
PHP Version: OS:

 

 [2019-04-14 10:14 UTC] phpbugreport at mailinator dot com
Description:
------------
Hi, 
Epoch time function strftime('%s') call returns empty on Windows but works on Linux.
Tested PHP builds:
PHP 7.3.2 (cli) (built: Feb  5 2019 23:14:21) ( NTS MSVC15 (Visual C++ 2017) x86)
PHP 7.3.4 (cli) (built: Apr  2 2019 22:13:15) ( NTS MSVC15 (Visual C++ 2017) x86)
PHP 7.0.33-0+deb9u3 (cli) (built: Mar  8 2019 10:01:24) ( NTS )

Cannot strftime('%s') be defined as alias to time()? If not can it be explicitly written in the manual (i.e. doesn't work in Windows).
Thanks. 

Test script:
---------------
<?php
echo "time()=".time()."\n";
echo "strftime('%s')=".strftime('%s')."\n";
?>

Expected result:
----------------
time()=1555236075
strftime('%s')=1555236075

Actual result:
--------------
time()=1555236100
strftime('%s')=

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-14 10:25 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2019-04-14 10:25 UTC] requinix@php.net
The documentation already warns you about this:

> Not all conversion specifiers may be supported by your C library...
> For Windows systems, a complete overview of supported conversion specifiers can be found at ยป MSDN.
http://msdn.microsoft.com/en-us/library/fe06s4ak.aspx
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC