Skip to content

Instantly share code, notes, and snippets.

@twhid
Created April 19, 2014 02:24
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 twhid/11071931 to your computer and use it in GitHub Desktop.
Save twhid/11071931 to your computer and use it in GitHub Desktop.
BBEdit Text Filter to transform unix timestamp to human a readable string in the UTC time zone.
#!/usr/local/bin/node
// Note that a more standard node hashbang doesn't seem to work
// in a BBEdit Text Filter (or perhaps it's Homebrew installed node weirdness).
// So, change the hashbang to a path to your node executable
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (data) {
process.stdout.write((new Date(data * 1000)).toUTCString());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment