Time Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
voodoo9055
Forum Commoner
Posts: 51
Joined: Sat Apr 26, 2003 3:27 pm
Location: Montgomery, AL

Time Question

Post by voodoo9055 »

How does one change 13:00 to 1:00 in PHP?

All of my times are showing up in military time.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

How are you generating your times?

Mac
User avatar
voodoo9055
Forum Commoner
Posts: 51
Joined: Sat Apr 26, 2003 3:27 pm
Location: Montgomery, AL

Post by voodoo9055 »

For example:

Code: Select all

<? echo date("d M Y H:i", $f_record&#1111; timesent ]); ?>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have a read of this for generating dates in the format you want, you just need to change slightly how you are using the date() function:
http://www.php.net/manual/en/function.date.php

And read this to find out why you should be quoting array element names:
http://www.php.net/manual/en/language.t ... rray.donts

Mac
User avatar
voodoo9055
Forum Commoner
Posts: 51
Joined: Sat Apr 26, 2003 3:27 pm
Location: Montgomery, AL

Post by voodoo9055 »

I didn't know that about the second part. Hey thanks alot! :D
Post Reply