Michael,
> I am looking for perl, php and mysql functions to produce the exact same
> iso week number (yes, there are 7 modes of this, based on my research)
>
> the custom iso_week() function seems to be the same if not exactly the
> same as mysql WEEK(time,3) (mode 3), and for that matter, the same as
> DateTime.pm.
> (first week of year is first week with a thursday in it, or, first week,
> starting on monday with 4 or more days..., so dec 28, 2008 is year 2008,
> week 52, jan 1, 2009 is year 2008, week 52 )
Yes, it is indeed equivalent to MySQL week(date,3), as documented in the code:
# Given a Unix numeric time (seconds since 1970-01-01T00:00Z),
# provide a week number 1..53 (local time) as specified in ISO 8601 (EN 28601)
# ( equivalent to PostgreSQL extract(week from ...), and MySQL week(date,3) )
#
sub iso8601_week($) { ... }
> is there any reason you wrote a function rather then used one? aside
> from one more module that would need to be included?
Yes, that was the main reason - avoiding yet another dependency,
and in this case, quite a heavy-weight one.
Mark
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/