Page 1 of 1

Time problem

Posted: Wed Aug 08, 2007 10:58 am
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...?

Re: Time problem

Posted: Wed Aug 08, 2007 12:13 pm
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" ...

Posted: Wed Aug 08, 2007 12:19 pm
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...

Posted: Wed Aug 08, 2007 12:27 pm
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");

Posted: Wed Aug 08, 2007 12:33 pm
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...

Posted: Wed Aug 08, 2007 12:40 pm
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"

Posted: Wed Aug 08, 2007 12:45 pm
by gaogier
oh, i get whats happened...


i feel soo stupid...