php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39373 strftime does not output %D (%m/%d/%y)
Submitted: 2006-11-04 10:12 UTC Modified: 2006-11-04 11:20 UTC
From: djhobson at bigpond dot net dot au Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.0 OS: Win XP SP 2 - Latest Patches
Private report: No CVE-ID: None
 [2006-11-04 10:12 UTC] djhobson at bigpond dot net dot au
Description:
------------
strftime() is failing to output the designated results as given to the specified online PHP documents.

Reproduce code:
---------------
Script Name:-
gettime.php

Script contents:-

<?php
  $time = 1162623699;
  $date = strftime("%D", $time);
  $theclock = strftime("%T", $time);
  
  $currenttime = $date." ".$theclock;
  echo $currenttime."\r\n";
  exit;
    
?>

Output:-

Y:\>php gettime.php


Y:\>

PS: I see there is already a post in regards to %T output, but %D is the same!

Expected result:
----------------
Expected results from online & current downloadable documentation is that from the given code I should see something like:-

%D - same as %m/%d/%y 

%T - current time, equal to %H:%M:%S 

Simply, NOT HAPPENING MAN!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-04 10:28 UTC] derick@php.net
Please read the 2nd paragraph of:
http://no2.php.net/strftime
 [2006-11-04 11:04 UTC] djhobson at bigpond dot net dot au
Read 2nd paragraph of strftime() and results are the same! 

THIS IS A MAJOR BUG!
 [2006-11-04 11:10 UTC] djhobson at bigpond dot net dot au
OIC Now!!! k, thanks derek, please ignore this post and I will repost on my later findings.  Thank you!
 [2006-11-04 11:14 UTC] djhobson at bigpond dot net dot au
Hey Derek!

Would you not think this is wise to put this into your documentation to alert window users of such circumstances with the current C libraries they may have installed on their systems?
 [2006-11-04 11:20 UTC] djhobson at bigpond dot net dot au
Sorry Derek,

I see now after searching a bit more through the documentation that this is clearly indicated.

------
Note: 
Not all conversion specifiers may be supported by your C library, in which case they will not be supported by PHP's strftime(). Additionally, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. %e, %T, %R and %D (there might be more) and dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems. For Windows systems a complete overview of supported conversion specifiers can be found at this ? MSDN website. 
-----

My bad, and I appologise!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 19:01:34 2025 UTC