|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-21 11:13 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 19:00:01 2025 UTC |
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