Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Support for ISO 8601 Week Numbers

Closed Thread
 
Thread Tools Display Modes
Old 03-29-2007   #1 (permalink)
Thomas Lee
Guest


 

Support for ISO 8601 Week Numbers

Looking at get-date, and the datetime object returned, it looks like
there is no support for ISO 8601 week numbers. :-(

ISO8601 is widely used in Europe and has a standard week numbering
(1=1st week, 2=2nd, etc).

This is an annoyance, especially given:
http://support.microsoft.com/kb/200299/en-us

I've been asked - is there any potential, or even any intention of
providing ISO8601 week number support into PowerShell?

Thomas
--
Thomas Lee
doctordns@gmail.com
MVP - Admin Frameworks and Security
Old 03-30-2007   #2 (permalink)
Neil Chambers
Guest


 

Re: Support for ISO 8601 Week Numbers


"Thomas Lee" <tfl@psp.co.uk> wrote in message
news:7zlmWuVEPEDGFAvg@mail.psp.co.uk...
> Looking at get-date, and the datetime object returned, it looks like there
> is no support for ISO 8601 week numbers. :-(
>
> ISO8601 is widely used in Europe and has a standard week numbering (1=1st
> week, 2=2nd, etc).
>
> This is an annoyance, especially given:
> http://support.microsoft.com/kb/200299/en-us
>
> I've been asked - is there any potential, or even any intention of
> providing ISO8601 week number support into PowerShell?
>
> Thomas
> --
> Thomas Lee
> doctordns@gmail.com
> MVP - Admin Frameworks and Security


Try

>get-date -uFormat %W

12

>get-date -uFormat %V

13

n

Old 03-31-2007   #3 (permalink)
Thomas Lee
Guest


 

Re: Support for ISO 8601 Week Numbers

In message <DD6597E7-4ABB-4A90-AB64-BF50B01047AF@microsoft.com>, Neil
Chambers <nospamplease@nospam.com> writes

>Try
>
>>get-date -uFormat %W

>12
>
>>get-date -uFormat %V

>13


Does this also have the bug noted in
http://support.microsoft.com/kb/200299/en-us??

--
Thomas Lee
doctordns@gmail.com
MVP - Admin Frameworks and Security
Old 03-31-2007   #4 (permalink)
gelyon@gmail.com
Guest


 

Re: Support for ISO 8601 Week Numbers

This doesn't return the correct week number for ISO 8601:

Get-Date "12/31/2007" -uFormat %V

Neither does this:

$cal = New-Object "System.Globalization.GregorianCalendar"
$dt = Get-Date "12/31/2007"
$woy = $cal.GetWeekOfYear( $dt, "FirstFourDayWeek", "Monday" )

Write-Host ("Date: " + $dt.ToString("D"))
Write-Host ("Week number: " + $woy.ToString())

The ISO Week Date Calendar
http://personal.ecu.edu/mccartyr/isowdcal.html



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Day of Week dm3281 PowerShell 9 06-21-2008 08:07 PM
By Week Mary Vista mail 1 12-05-2007 06:59 AM
Gone for a week Gary VanderMolen Vista mail 0 05-29-2007 09:11 PM
SKU numbers churin Vista General 5 04-11-2007 10:26 PM
Sp1 next week Howard Huntley Vista General 4 03-31-2007 05:14 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50