MYSQl DATETIME string Format |
[eluser]Yash[/eluser]
Code: date("l, F jS, Y n:i A",strtotime($posts['PostedDate'])); Monday, February 3rd, 2003 2:11 PM Now I want Monday, February 3th, 2003 at 2:11 PM I mean want to add "at" in between and rd to be replaced with th
[eluser]xwero[/eluser]
the S you added should take care of the th like you can see on the php.net date function page. The at you can add by escaping the word with a backslash, but because the t is a character that is in the date formating you need to double backslash it. (see the second example on the same php.net page)
[eluser]parrots[/eluser]
S will give you suffix based on the number, 1 => st, 2 => nd, 3 => rd, 4+ => th. So it isn't giving you "th" because "3th" isn't correct ![]()
[eluser]Yash[/eluser]
I already got that... anyways thank you for making things crystal clear. |
Welcome Guest, Not a member yet? Register Sign In |