1.4.1 bug report - Can't apply php date format %j 1.4.1 bug report - Can't apply php date format %j
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

1.4.1 bug report - Can't apply php date format %j

Started by itang, April 26, 2005, 05:22:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

itang

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.


Nibbler

I'm not too sure this is a bug, but moving it anyway.

Nibbler

From php manual:

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

Seems to be pretty much as expected.

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

itang

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. :-[