# HG changeset patch # User Matti Hamalainen # Date 1402874904 -10800 # Node ID a38c123921a92615f9fef7a12154c37bf70989f0 # Parent 9eee4e1b757c0521aaddee528a2d324d5bb6904e Change the timestamp parsing. diff -r 9eee4e1b757c -r a38c123921a9 fetch_weather.pl --- a/fetch_weather.pl Mon Jun 16 01:54:56 2014 +0300 +++ b/fetch_weather.pl Mon Jun 16 02:28:24 2014 +0300 @@ -58,8 +58,15 @@ sub parse_timestamp($$) { - # XXX: A bit of a hack, but it works. - return Time::Piece->strptime($_[0], "%H:%M")->epoch + $_[1]; + my ($str, $offs) = @_; + if ($str =~ /^(\d+):(\d+)$/) + { + return $offs + (60 * 60 * $1) + ($2 * 60); + } + else + { + return $offs; + } }