Skip to main content
10 of 15
added 363 characters in body
globby
  • 1.2k
  • 5
  • 5

Rise and Shine

The challenge is to create a program which takes a date, a latitude, and a longitude, and prints the time of the sunrise on that date for the given location.

The program must work for any valid date between January 1, 2000, and December 31, 2999.

Internal and external sunrise functions are disallowed. Date libraries are allowed only to format the output into ISO 8601

###Clarifications###

  • You do not need to take into account altitude or the refraction of light from the sun.
  • Date input and output must be in correct ISO8601 format
  • The date, latitude, and longitude will be given as a space separated string, in that order, on stdin
  • Printing a value means outputting to stdout
  • The output should have a precision of +/- 1 second
  • The time outputted must be in the local time of the location specified

###Bonus###

  • Score * 0.85 if you also print out the time zone code with the time, without using a date library to get the code
  • Score * 0.9 if you do not use a date library at all

This is code-golf, so least bytes wins.

globby
  • 1.2k
  • 5
  • 5