Please feel free to provide feedback or file bugs here.

[datetime] type accelerator only uses en-US culture

The [datetime] when used as a type accelerator only uses the en-US culture and therefore other date formats either error out or they are interpreted incorrectly, This makes using the ConvrtFrom-String difficult when adding type accelerators to automatically discover the property type from text. If we use the Get-Date command then the correct culture is used. It appears to be just the [datetime] type accelerator that is not consistent with this? Please fix!!

4 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Brent Denny shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • David commented  ·   ·  Flag as inappropriate

        Yes. Persists into version 5:
        [PS] H:\>get-culture

        LCID Name DisplayName
        ---- ---- -----------
        2057 en-GB English (United Kingdom)
        [PS] H:\>[datetime]"$((get-date -Year 2017 -Month 11 -Day 2).ToString())" -eq (get-date -Year 2017 -Month 11 -Day 2)
        False

      Feedback and Knowledge Base