Is there a way to show only the time in this?

This topic contains 2 replies, has 2 voices, and was last updated by  Vandrey Trindade 2 years, 2 months ago.

  • Author
  • #39321

    Vandrey Trindade


    I'm trying to show only the time on this:

    (get-date -displayhint time).addminutes(35)

    But it show everything... =/
    Any idea how to make it? I want only the hours and the minutes (Ex.: 09:35)

  • #39322

    Don Jones

    Sure. If you were to pipe your result to Get-Member, you'll see a number of properties and methods that let you access portions of the date/time object. For example...

    $tomorrow = (Get-Date).AddDays(1)
    $tomorrow | gm

    I often use...


    When I need a short date. You might want ToShortTimeString() or something.

  • #39324

    Vandrey Trindade

    Thanks once again Don Jones!

You must be logged in to reply to this topic.