normally date format in mssql are datetime...
when select the date , result will be 03/25/2003 1200:0:0 something like that..
any method can changing that only display date?
no matter i use below which method , the result incorrect ..
$pdate = date("M/d/Y", mktime($row[APPLY_DATE])) ;
$pdate1 = date("M, d Y", $row[DATE_TO]) ;
any one can help me ...
thank u
changing mssql date
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have you tried to format the date in the database? MySQL has a function called DATE_FORMAT() does MS SQL have something similar?
The reason the code you have is not working is because you are using mktime() incorrectly:
http://www.php.net/manual/en/function.mktime.php
If you can't format the date in the database (which is preferable) you need to split up the date and time into it's constituent parts - seconds, minutes, hours, day, month, year - before you can use it in mktime():
http://www.php.net/manual/en/function.explode.php
Mac
The reason the code you have is not working is because you are using mktime() incorrectly:
http://www.php.net/manual/en/function.mktime.php
If you can't format the date in the database (which is preferable) you need to split up the date and time into it's constituent parts - seconds, minutes, hours, day, month, year - before you can use it in mktime():
http://www.php.net/manual/en/function.explode.php
Mac