-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Parse Pocket results; convert from Epoch time
- Loading branch information
Showing
5 changed files
with
107 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<# | ||
.SYNOPSIS | ||
Converts an integer Unix (POSIX) time (seconds since Jan 1, 1970) into a DateTime value. | ||
.INPUTS | ||
System.Int32 value converted from date and time value. | ||
.OUTPUTS | ||
System.DateTime value to convert to integer. | ||
.FUNCTIONALITY | ||
Date and time | ||
.LINK | ||
https://en.wikipedia.org/wiki/Unix_time | ||
.LINK | ||
https://stackoverflow.com/a/1860511/54323 | ||
.LINK | ||
Get-Date | ||
.EXAMPLE | ||
1556884381 |ConvertFrom-EpochTime.ps1 | ||
Friday, May 3, 2019 11:53:01 | ||
#> | ||
|
||
#Requires -Version 3 | ||
[CmdletBinding()][OutputType([int])] Param( | ||
# The Epoch time value to convert to a DateTime. | ||
[Parameter(Mandatory=$true,ValueFromPipeline=$true)][long] $InputObject, | ||
# Indicates the DateTime provided is local, and should be converted to UTC. | ||
[Alias('UTC','Z')][switch] $UniversalTime | ||
) | ||
Process{(Get-Date 1970-01-01 -AsUTC:$UniversalTime).AddSeconds($InputObject)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ Tricia McMillan [email protected] | |
[CmdletBinding()][OutputType([psobject])] Param( | ||
# The MatchInfo output from Select-String to select named capture group values from. | ||
[Parameter(Position=0,ValueFromRemainingArguments=$true,ValueFromPipeline=$true)] | ||
[Alias('InputObject')][Microsoft.PowerShell.Commands.MatchInfo]$MatchInfo, | ||
[Alias('InputObject')][Microsoft.PowerShell.Commands.MatchInfo] $MatchInfo, | ||
# Return the capture group values without building objects. | ||
[switch] $ValuesOnly | ||
) | ||
|