coppermine-gallery.com/forum

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: itang on April 26, 2005, 05:22:51 PM

Title: 1.4.1 bug report - Can't apply php date format %j
Post by: itang on April 26, 2005, 05:22:51 PM
I am using PHP Version 4.2.2. Try to modify the date format of coppermine 1.4.1 with the format %Y-%b-%j.

The result should be like this: 2004-4-5

However, it came out like this: 2004-4-095

Thanks for your attention.

Title: Re: 1.4.1 bug report - Can't apply php date format %j
Post by: Nibbler on April 26, 2005, 05:34:42 PM
I'm not too sure this is a bug, but moving it anyway.
Title: Re: 1.4.1 bug report - Can't apply php date format %j
Post by: Nibbler on April 26, 2005, 05:38:09 PM
From php manual:

%j - day of the year as a decimal number (range 001 to 366)

Seems to be pretty much as expected.
Title: Re: 1.4.1 bug report - Can't apply php date format %j
Post by: Casper on April 26, 2005, 05:38:36 PM
Quote from: itang on April 26, 2005, 05:22:51 PM
I am using PHP Version 4.2.2. Try to modify the date format of coppermine 1.4.1 with the format %Y-%b-%j.

The result should be like this: 2004-4-5

However, it came out like this: 2004-4-095

Thanks for your attention.



That is actually correct.  You are using 'j', which is the day of the year, not month.

Quote%j - day of the year as a decimal number (range 001 to 366)

Change the j to an 'd' or 'e' and you will get what you want

Edit, nibbler beat me to it, but after typing it out, I posted it anyway lol.
Title: Re: 1.4.1 bug report - Can't apply php date format %j
Post by: itang on April 26, 2005, 06:05:53 PM
It is my fault, I am so sorry to bring up this silly question.

The fact is I mixed up the function "date" - which "j" refer to "Day of the month without leading zeros" with the "strftime" function which "%j" refer to day of the year as a decimal number (range 001 to 366)

I am sorry again. :-[