datetime default output format

This topic contains 7 replies, has 5 voices, and was last updated by  selko 2 months, 2 weeks ago.

  • Author
    Posts
  • #95798

    selko
    Participant

    Hi,
    if i type Get-Date i get the following output (german):

    Dienstag, 13. März 2018 12:34:47
    (Get-Date).GetType()
    IsPublic IsSerial Name                                     BaseType
    -------- -------- ----                                     --------
    True     True     DateTime                                 System.ValueType

    It is a DateTime object.

    I would like to change the default output of Get-Date to 13.03.2018 12:34:47 but keep the Type as DateTime (so i cant you ToString()??)

    Can i do this without changing the regional settings in Windows?
    Can you suggest how the get to this?

    Thanks

  • #95799

    Simon B
    Participant

    Could you not use

    Get-Date -Format "ddMMyyyy HH:MM:ss"

    • #95801

      selko
      Participant

      It is changed to string object then.

  • #95804

    js
    Participant
  • #95813

    Don Jones
    Keymaster

    It's determined by your operating system settings. So no, you can't modify it except by making a String.

You must be logged in to reply to this topic.