Copy link to clipboard
Copied
Hi all,
I just figured out the week function is adding a week to the actual week of year.
A date of 2010-07-21 returns a week of 30 not 29. And ideas??
This a Windows 2003 server running Coldfusion MX 7
Many thanks for the help.
Brian
Copy link to clipboard
Copied
Why is 30 incorrect? Jan 1, 2010 is included in week 1. You count from there till July 21, 2010 and you'll get week 30.
Copy link to clipboard
Copied
It might be time to upgrade CF. I just ran a test on CF8, and both week() and datePart() return 29 for the week number for 21/7/2010.
--
Adam
Copy link to clipboard
Copied
So, January 1 was a Friday, right? Here's what my data warehouse thinks about that.
select datepart(week, '20100102') from u_one; -- Saturday
1
select datepart(week, '20100103') from u_one; -- Sunday
2
select datepart(week, current_date) from u_one;
30
Copy link to clipboard
Copied
Dan Bracuk wrote:
So, January 1 was a Friday, right? Here's what my data warehouse thinks about that.
select datepart(week, '20100102') from u_one; -- Saturday
1
select datepart(week, '20100103') from u_one; -- Sunday2
select datepart(week, current_date) from u_one;
30
A system conforming to ISO 8601 would disagree there. Firstly, weeks start on a Mon as far as these things go (obviously human calendars vary by country, standards-adhering ones do not), so both of those should be the same week.
Also, Week 1 is the week that has the first Thursday of the year in it, so Week 1 doesn't start until the Monday after your test dates. Those dates are in week 53 from the previous year.
CF (well: CF8, anyhow) seems to conform to ISO 8601. CFMX7... seemingly not so much.
Ref: http://en.wikipedia.org/wiki/ISO_week_date
--
Adam
Copy link to clipboard
Copied
OK so Im probably not doing anything wrong then?? Maybe? So if this is an issue with MX7 you would think there would be a fix for it. Where does CF calculate this information from? The OS, JRE? I think I would find more people that had run into this issue. Makes me think I have something wrong or misconfigured. I hate work arounds but can anyone offer any suggestions?
Thanks all for the help.
Brian
Copy link to clipboard
Copied
Java does almost all the work. Maybe upgrade your JVM? note: Verity - if you use it - might have issues with the latest JVMs, but CFMX itself should be fine (test first!).
I would not expect any further hotfixes or updates for CFMX7 as it's:
A) five years old;
B) into "extended support";
C) two versions behind the current state of play.
What your expectation should be here is that it's perhaps about time to upgrade
--
Adam