Week number

Week number according to the ISO-8601 standard, weeks starting on Monday. The first week of the year is the week that contains that year’s first Thursday. The highest week number in a year is either 52 or 53.

Week number in PHP

$weekNumber = date("W");

Week number in Perl

my $weekNumber = POSIX::strftime("%V", gmtime time);

Week number in MySQL:

 SELECT WEEKOFYEAR(NOW())

Week number in MS SQL Server

SELECT DATEPART( wk, GETDATE() )

Comments (2)

AndreyVDecember 5th, 2009 at 17:13

No offence, but the last one is the ugliest one :)

Lev ShuvalovDecember 10th, 2009 at 00:15

:)

Leave a comment

Your comment