Page 1 of 1

How to know the time coming form databse is in 'am' or 'pm'?

Posted: Mon Apr 06, 2009 5:39 am
by RishikeshJha
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

Re: How to know the time coming form databse is in 'am' or 'pm'?

Posted: Mon Apr 06, 2009 5:43 am
by requinix
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'?

Posted: Mon Apr 06, 2009 6:31 am
by RishikeshJha
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.
thanks dear it?????

Re: How to know the time coming form databse is in 'am' or 'pm'?

Posted: Mon Apr 06, 2009 7:17 am
by requinix
RishikeshJha wrote:thanks dear it?????
Was that a question?