Mark Martinec wrote:
> 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:
>
>   
im tracking down some 'anomalies' when I tried to audit iso_week vs the 
perl code  vs week(,3).
I took (select * from msgs) compared the time_num and time_iso 
(adjusting for EST5EDT to GMT), checked to see who and what week it used.

if anyone wants to check their systems, try this: (substituting your 
timezone for EST5EDT, must exist in mysql.time_zone_names)

select count(*) from msgs where 
convert_tz(from_unixtime(time_num),'EST5EDT','GMT')  != time_iso;

I found time times that seems to be off by 4 hours or so, on several 
systems and haven't tracked it down (and, yes, off by 12 hours on sunday 
night or monday am messes with week number) looks like an internal 
routine change to GMT twice.


select time_num,time_iso,mail_text from msgs natural join quarantine where
mail_id='laxXdNiql-+j' and partition_tag=0\G
*************************** 1. row ***************************
 time_num: 1249933472
 time_iso: 2009-08-10 23:44:32
mail_text: X-Envelope-From: <[email protected]>
X-Envelope-To: <[email protected]>
X-Envelope-To-Blocked:
X-Quarantine-ID: <laxXdNiql-+j>
X-Spam-Flag: NO
X-Spam-Score: -115.236
X-Spam-Level:
X-Spam-Status: No, score=-18.599-96.637 tag=-999 tag2=5 kill=10
        tests=[AM:BOOST=-96.637, BAYES_00=-2.599, DCC_REPUT_00_12=-1,
        ENV_AND_HDR_SPF_MATCH=-7.5, RELAY_COUNTRY_US=0.001, SPF_PASS=-0.001,
        USER_IN_DEF_SPF_WL=-7.5] autolearn=ham
Received: from mx2.secnap.com.ionspam.net ([216.134.223.54])
        by localhost (mx2.secnap.com.ionspam.net [216.134.223.54]) 
(SpammerTrap(r)
VPS-1500, port 10024)
        with LMTP id laxXdNiql-+j for <[email protected]>;
        Mon, 10 Aug 2009 15:44:32 -0400 (EDT)

mail logs confirm, 15:44 EDT.

this query will find them all:

select content,convert_tz(from_unixtime(time_num),'EST5EDT','GMT')  as 
time ,
time_iso from msgs where 
convert_tz(from_unixtime(time_num),'EST5EDT','GMT')
!= time_iso  order by time_iso;

_________________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.spammertrap.com
_________________________________________________________________________

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; 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&#45;12, 2009. Register now&#33;
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/ 

Reply via email to