php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #608 date returning "His" in strange order?
Submitted: 1998-08-02 11:57 UTC Modified: 1998-08-03 11:24 UTC
From: kk at shonline dot de Assigned:
Status: Closed Package: Performance problem
PHP Version: 3.0.2a OS: Solaris 2.5.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kk at shonline dot de
New email:
PHP Version: OS:

 

 [1998-08-02 11:57 UTC] kk at shonline dot de
webuser@poe ~ $ ../cgi/php -v
3.0.2a
webuser@poe ~ $ ../cgi/php   
<?php
$timeout = mktime(date("s"), date("i"), date("H"),
                   date("m"), date("d"), date("Y"));
$sqldate = date("YmdHis", $timeout-1440*60);
print $sqldate;
Content-type: text/html
 
19980802025317
$timeout = mktime(date("s"), date("i"), date("H"),
                 date("m"), date("d"), date("Y"));
$sqldate = date("YmdHis", $timeout-1440*60);
print $sqldate;
19980802055317
webuser@poe ~ $ date
Sun Aug  2 17:53:32 MET DST 1998

As you can see, I coded YmdHis, but I get YmdsiH. How come?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-03 11:24 UTC] rasmus
You are feeding arguments to mktime in sec/minute/hour/month/day/year format when the function is defined to take hour/minute/sec/month/day/year, so it is entirely expected that your "His" comes out as "siH" since that is the order you provided to mktime().  So, no PHP bug here.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 25 04:01:24 2020 UTC