splitting time form system date time

Welcome Forums General PowerShell Q&A splitting time form system date time

This topic contains 1 reply, has 2 voices, and was last updated by

1 year, 9 months ago.

  • Author
  • #69900

    Points: 0
    Rank: Member

    5/1/2017 7:00:00 AM

    I would like to get just 7:00:00 AM data from the above system.datetime value

    Is there way to get it instead of converting the system.datetime to string and splitting the string

  • #69907

    Points: 527
    Helping Hand
    Rank: Major Contributor

    You need to use the -Format switch to get parts of a date\time. See: https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx

    Get-Date -Date "5/1/2017 7:00:00 AM" -Format "T"

The topic ‘splitting time form system date time’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort