i use sql2000, so the date format i query are apr, 1 2003, 12:00
but i want split it to 04/01/2003 ...
but i can't change the date format from apr to 04..
below is my code.. anyone can help me ??
thank u
list ($mon,$day,$year, $time) = split (' ', $Itemrow[StartDate]) ;
$repairDate = date('m/d/Y', mktime(0,0,0, "$mon,$day,$year"));
date conversion
Moderator: General Moderators
actually not split problem , i just split the date. but apr is string ..Malder wrote:try explode instead of split
when use mktime (0,0,0 int,int,int ) so i can't convert it string to int..
list ($mon,$day,$year, $time) = explode(' ', $Itemrow[StartDate]) ;
$repairDate = date('m/d/Y', mktime(0,0,0, $mon,$day,$year));
-
Tubbietoeter
- Forum Contributor
- Posts: 149
- Joined: Fri Mar 14, 2003 2:41 am
- Location: Germany
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you can't adjust the date in the database (which would be the best solution) then you should look into strtotime():
http://www.php.net/manual/en/function.strtotime.php
Mac
http://www.php.net/manual/en/function.strtotime.php
Mac