Skip to content

Instantly share code, notes, and snippets.

@beppu
Created August 10, 2015 00:22
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 beppu/03b7069e22ca5a0836e6 to your computer and use it in GitHub Desktop.
Save beppu/03b7069e22ca5a0836e6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use JSON;
while (<>) {
my $relay = decode_json $_;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(int($relay->{coldTimestamp} / 1000));
my $date = sprintf('%d-%02d-%02d', $year+1900, $mon+1, $mday);
print "$date $_"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment