![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 Specs![]() |
| | #3 (permalink) |
| 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 Specs![]() |
![]() |
| 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 |