[ic] time tag with adjust in February bug?

Stefan Hornburg (Racke) racke at linuxia.de
Sun Mar 31 14:51:13 UTC 2013


On 03/31/2013 04:27 PM, Paul Jordan wrote:
> 
> Doing this today:
> 
> A)    [time]%c[/time] <br />
> B) - 1d: [time adjust='-1 day']%c[/time] <br />
> C) - 1m1d: [time adjust='-1 month 1 day']%c[/time] <br />
> D) - 2m1d: [time  adjust='-2 month 1 day']%c[/time] <br />
> 
> gives me:
> 
> A)                Sun Mar 31 07:04:42 2013
> B) - 1d:        Sat Mar 30 07:04:42 2013
> C) - 1m1d:   Sat Mar 2 06:04:42 2013
> D) - 2m1d:   Wed Jan 30 06:04:42 2013
> 
> Notice run C. Reaching past February seems to produce logical results, and I
> have not noticed the system this code is running in producing oddities until
> this, so think it has something to do with February specifically.
> 
> I guess it comes down to deciding what happens when minus one month and one
> day is logically the same over a period of days. Would it be Feb 27th on
> March 28, 29, 30, and 31?
> 
> What is adjust="- 1 month" doing? I would think it just reduces the month
> field date-wise, and checks the if the day number exists in that result
> month, and if not - use the last day number available for that result month.
> 
> Does that make presumptions not in line with the intentions of that
> facility?
> 

The difference of one hour can be explained by the Daylight Saving Time (DST).
Use UTC "timezone" for calculations which shouldn't be affected by DST.

Regards
	Racke


-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team




More information about the interchange-users mailing list