Skip to content

Get-Date, add documentation on -FromUnixTime parameter #5727

Closed

Description

@jackdcasey

Documentation Issue

This is in regards to PR: PowerShell/PowerShell#12179
Add FromUnixTime switch to Get-Date to allow Unix time input

Context of the issue

  • URL to the article (Docs or GitHub URL): Get-Date Documentation

  • Issue affects the following content (check all that apply):

    Cmdlet reference & about_ topics

    • Version 7.x preview content
    • Version 7.0 content
    • Version 6 content
    • Version 5.1 content

    Conceptual articles

    • Fundamental conceptual articles
    • Script sample articles
    • DSC articles
    • Gallery articles
    • JEA articles
    • WMF articles
    • SDK articles
  • Is the issue specific to a platform (Y/N - Win/macOS/Linux): N

Detailed description of the issue

This allows the input of a Unix timestamp into Get-Date. This is currently impossible, as the default unit for a numeric input is ticks.

Adding this switch would allow the user to specify if the input is Unix time, while also keeping full previous compatibility with ticks.

Here is an example output with, and without the switch:

> Get-Date -Date 1584947314 -FromUnixTime

 Monday, March 23, 2020 7:08:34 AM

> Get-Date -Date 1584947314

 Monday, January 1, 0001 12:02:38 AM

Activity

  1. added
    area-utility
    and removed
    issue-question
    on Apr 7, 2020
  2. added this to the 7.1.0 milestone on Apr 7, 2020
  3. added a commit that references this issue on Apr 8, 2020
    97ac40d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-utility

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions