Hi,
i used to store joing date in datetime fromate in mysql. i want to fetch this field and show it in frontend like 2 april 2009 01:07 am or 2 april 2009 01:07 pm. Can anyone give me soloution how i can know that the time is in am or pm???
Thanks in advance.....
Rishikesh
How to know the time coming form databse is in 'am' or 'pm'?
Moderator: General Moderators
-
RishikeshJha
- Forum Newbie
- Posts: 11
- Joined: Tue Mar 31, 2009 1:54 am
Re: How to know the time coming form databse is in 'am' or 'pm'?
If the hour is 0 then it's midnight, 1-11 is AM, 12 is noon, and 13-23 is PM (subtract 12).
Or you could let MySQL do it for you.
Or you could let MySQL do it for you.
-
RishikeshJha
- Forum Newbie
- Posts: 11
- Joined: Tue Mar 31, 2009 1:54 am
Re: How to know the time coming form databse is in 'am' or 'pm'?
thanks dear it?????tasairis wrote:If the hour is 0 then it's midnight, 1-11 is AM, 12 is noon, and 13-23 is PM (subtract 12).
Or you could let MySQL do it for you.
Re: How to know the time coming form databse is in 'am' or 'pm'?
Was that a question?RishikeshJha wrote:thanks dear it?????