Time problem

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
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Time problem

Post by gaogier »

Hello,

Its not a huge problem, but, the code im about to show you, has an f in it... but why?

Code: Select all

Today's Date: <?php echo date("jS of F Y"); ?>
We have used the same code for years, no problems, then one day, and f came into the code... whats wrong...?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: Time problem

Post by volka »

gaogier wrote:then one day, and f came into the code... whats wrong...?
sure? I knew an explaination if "suddenly" an "o" was missing, but an extra-"f" ...
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

take a look

at the top of the page, it is everywhere


http://runehints.com

or take a look at our guides...

http://www.runehints.com/quest.php?flib ... id=75&ic=1


its the same, everywhere, just an f has popped up... no idea why...
User avatar
TheMoose
Forum Contributor
Posts: 351
Joined: Tue May 23, 2006 10:42 am

Post by TheMoose »

http://us2.php.net/date

A lowercase "o" returns:
ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0)
You need to escape that o, so it should be:

Code: Select all

date("jS \of F Y");
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

thanks, so when the server's php updated it added the f?

so i have to do that for each page with the dates... ok... great... long task ahead of me...

could expain why i couldnt find it in my php 4 book...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

thanks, so when the server's php updated it added the f?
No, it did not add an "f" but since php 5.10 it replaces the "o" with the ISO-8601 year.
5.1.0, no wonder why there is nothing about it in a php 4 book.

date("jS of F Y");
before 5.1.0: 8th of August 2007
since 5.10: 8th 2007f August 2007
It did not add an "f"
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

oh, i get whats happened...


i feel soo stupid...
Post Reply