Created
August 14, 2019 03:25
-
-
Save ericlaw1979/014332929979def9b5f3eeac0cce7fc2 to your computer and use it in GitHub Desktop.
FiddlerScript unix epoch datetime converter
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
//Scroll to just inside class Handlers and add the following block: | |
public static ToolsAction("E&poch Analyzer") | |
function showTime() { | |
var s = FiddlerScript.prompt("Enter an Epoch time", DateTimeOffset.Now.ToUnixTimeSeconds(), "Epoch Analyzer"); | |
try { | |
var sec= Int64.Parse(s); | |
var dt: DateTimeOffset = DateTimeOffset.FromUnixTimeSeconds(sec); | |
FiddlerScript.alert("Unix Epoch time "+s+" is:\n\tLocal:\t"+dt.ToLocalTime().ToString()+"\n\tGMT:\t"+dt.ToString()); | |
} | |
catch (e) { FiddlerScript.alert("Invalid input\n"+e); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment