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


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)

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.

Thanks once again Don Jones!