php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31227 date in php
Submitted: 2004-12-21 11:10 UTC Modified: 2004-12-21 11:13 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: bego_xaudaro at hotmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: Irrelevant OS: win xp
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: bego_xaudaro at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-12-21 11:10 UTC] bego_xaudaro at hotmail dot com
Description:
------------
Hello,

i have d-m-yyyy and i want yyyy-mm-dd

example:

i have the date 1-2-2004 and i want 2004-02-01

how i can format the date??

i try with mktime() and list() but the result is incorrect
can anybody help me please?

thanks!

pd: sorry for my english



Reproduce code:
---------------
for example:

$data="1-2-2004";
list( $day, $month, $year ) = split( '-', $alta );
$alta=date("Y-m-d", mktime(0,0,0,$month,$day,$year)); 

Expected result:
----------------
i expect 2004-02-01

Actual result:
--------------
actual result: 1999-02-01

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-21 11:13 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 09:01:30 2025 UTC