I'm having a difficult time, based on the documentation, of figuring out how to equate week numbers between Perl and MySQL.
How would I calculate the same exact week number in both Perl and MySQL based on a unix timestamp in the same time zone?
SELECT DATE_FORMAT(from_unixtime(datefield), '%Y%U') FROM table;
and
print strftime('%Y%U', localtime($datevar));
should produce identical week numbers for any given timestamp. Ideally I'd like the week number to be something portable, such as ISO 8601. While the week numbers in my testing seem to match up sometimes, I can't find anything in the documentation for both Perl and MySQL that confirms that the date formatting clearly adheres to the same definition.
Thanks!