Skip to content

Instantly share code, notes, and snippets.

@skahack
Created May 23, 2011 08:21
Show Gist options
  • Save skahack/986393 to your computer and use it in GitHub Desktop.
Save skahack/986393 to your computer and use it in GitHub Desktop.
code golf - right time (http://golf.shinh.org/p.rb?right+time)
import System.Time
import System.Locale
import System.Posix.Env
main=do
putEnv("TZ=right/UTC")
interact$unlines.(>>= \s->[formatCalendarTime defaultTimeLocale "%Y-%m-%d %X".toUTCTime$TOD (case(read s::Integer)of;x|x>1230768022->x+1;x->x) 5]).lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment