Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Date in standard format for locale

Reply
 
Old 02-15-2007   #1 (permalink)
ten.nigriv@virgin.net


 
 

Date in standard format for locale

This may seem trivial, but I'm just looking at powershell for the first
time, and I appear to have a discrepency in my output. When I say
discrepency, I mean I was expecting as stated in the help pages `Date in
standard format for locale`.
Here is my output with the latter representing what I was expecting to be
the result of the second command.
#-----start-----
PS C:\WINDOWS\system32\windowspowershell\v1.0> get-date -uformat %D
02/15/07
PS C:\WINDOWS\system32\windowspowershell\v1.0> get-date -uformat %x
02/15/07
PS C:\WINDOWS\system32\windowspowershell\v1.0> get-date -uformat %d/%m/%y
15/02/07
#------end------
My Windows `Regional Settings` etc. are all set accordingly for United
Kingdom defaults. Can anyone help, or is it a fact that the `%x` parameter
doesn't work correctly.

My System SpecsSystem Spec
Old 02-15-2007   #2 (permalink)
RichS


 
 

RE: Date in standard format for locale

I get the same results.

PS> $host


Name : ConsoleHost
Version : 1.0.0.0
InstanceId : 9f23fe23-99dc-4cdb-a83b-cbb23badea45
UI :
System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-GB
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy

using $host shows that the CurrentUICulture is set to US english which is
why you get the date format of mm/dd/yy

Need to dig a bit to see how to change it
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"ten.nigriv@virgin.net" wrote:

> This may seem trivial, but I'm just looking at powershell for the first
> time, and I appear to have a discrepency in my output. When I say
> discrepency, I mean I was expecting as stated in the help pages `Date in
> standard format for locale`.
> Here is my output with the latter representing what I was expecting to be
> the result of the second command.
> #-----start-----
> PS C:\WINDOWS\system32\windowspowershell\v1.0> get-date -uformat %D
> 02/15/07
> PS C:\WINDOWS\system32\windowspowershell\v1.0> get-date -uformat %x
> 02/15/07
> PS C:\WINDOWS\system32\windowspowershell\v1.0> get-date -uformat %d/%m/%y
> 15/02/07
> #------end------
> My Windows `Regional Settings` etc. are all set accordingly for United
> Kingdom defaults. Can anyone help, or is it a fact that the `%x` parameter
> doesn't work correctly.
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
HELP website will only display in mobile format not standard. Browsers & Mail
changing windows date format General Discussion
Date Format - Change Tutorials
Converting date time format to string format PowerShell
Date Format Vista General


Vista Forums 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 Ltd

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