Repository navigation
Add -FromUnixTime to Get-Date to allow Unix time input - #12179
Travis Plunk (TravisEz13) merged 11 commits into
Conversation
|
Upon specifying UTC in the tests, I noticed a small inconsistency. When specifying the DateTime with ticks, or with unix time, the This was causing issues when combined with the To get around this, we can set the to |
This reverts commit c76eebe.
|
Jack Casey (@jackdcasey) Please create new issue in PowerShell-Docs repo for the new parameter and add reference in the PR description. Thanks! |
|
Opened issue in MicrosoftDocs/PowerShell-Docs: MicrosoftDocs/PowerShell-Docs#5727 |
-FromUnixTime to Get-Date to allow Unix time input
|
Jack Casey (@jackdcasey) Thanks for your contribution! |
|
Ilya (@iSazonov) Thank you for all the help! |
|
🎉 Handy links: |
|
Negative UnixTime is not supported? |
|
aetos (@aetos382) No. If you have a feature request please open new issue. |
PR Summary
My proposal, is to add a
-FromUnixTimeswitch to Get-Date.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:
PR Context
Closes #11719
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.