|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Convert date into a specified format:
Hello,
Say i have a date: '2005-01-27' (yy-mm-dd) Can someone help me write code to convert it into a format like this: '27 January 2005 (Thursday)' (dd MonthName Year (DayName)). I have tried to do this using the date function like this: PHP Code:
However i get the output as: 01 January 1970 (Thursday) which is incorrect! Thanks in advance Neville |
|
#2
|
||||
|
||||
|
I would use the numbers in the first format in the mktime() function to create the time in seconds. Then use that in the date() function to generate the time how you want it.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Convert date into a specified format: |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|