Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: 1.4.1 bug report - Can't apply php date format %j  (Read 6921 times)

0 Members and 1 Guest are viewing this topic.

itang

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 63
1.4.1 bug report - Can't apply php date format %j
« 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.

« Last Edit: April 26, 2005, 05:40:06 pm by Casper »
Logged

Nibbler

  • Guest
Re: 1.4.1 bug report - Can't apply php date format %j
« Reply #1 on: April 26, 2005, 05:34:42 pm »

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

Nibbler

  • Guest
Re: 1.4.1 bug report - Can't apply php date format %j
« Reply #2 on: April 26, 2005, 05:38:09 pm »

From php manual:

Code: [Select]
%j - day of the year as a decimal number (range 001 to 366)
Seems to be pretty much as expected.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: 1.4.1 bug report - Can't apply php date format %j
« Reply #3 on: April 26, 2005, 05:38:36 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.
Logged
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

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 63
Re: 1.4.1 bug report - Can't apply php date format %j
« Reply #4 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. :-[
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 21 queries.