#31227 [NEW]: date in php

From: Date: Tue, 21 Dec 2004 10:10:39 +0000
Subject: #31227 [NEW]: date in php
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-70820@lists.php.net to get a copy of this message
From: bego_xaudaro at hotmail dot com Operating system: win xp PHP version: Irrelevant PHP Bug Type: Date/time related Bug description: date in php 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 -- Edit bug report at http://bugs.php.net/?id=31227&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31227&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31227&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31227&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31227&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31227&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31227&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31227&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31227&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31227&r=support Expected behavior: http://bugs.php.net/fix.php?id=31227&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31227&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31227&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31227&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31227&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31227&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31227&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31227&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31227&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31227&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31227&r=mysqlcfg

« previous php.bugs (#70820) next »