Skip to content

Instantly share code, notes, and snippets.

@ericlaw1979
Created August 14, 2019 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericlaw1979/014332929979def9b5f3eeac0cce7fc2 to your computer and use it in GitHub Desktop.
Save ericlaw1979/014332929979def9b5f3eeac0cce7fc2 to your computer and use it in GitHub Desktop.
FiddlerScript unix epoch datetime converter
//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