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

Date in standard format for locale

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-15-2007   #1 (permalink)
ten.nigriv@virgin.net
Guest


 

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
Guest


 

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
Old 02-15-2007   #3 (permalink)
RichS
Guest


 

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
Closed Thread
Update your Vista Drivers Update Your Drivers Now!!

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Format - Change Brink Tutorials 0 05-26-2008 03:56 PM
how to set date format as dd/mm/yyyy of iis server Chetana .NET General 0 05-23-2008 05:52 AM
Converting date time format to string format IT Staff PowerShell 1 12-18-2007 03:49 AM
onvert reg_binary into date format. preetam.zaray@gmail.com PowerShell 6 06-19-2007 03:59 AM
Date Format Thom Little Vista General 2 04-15-2007 02:45 PM


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 51