A particularly interesting question with a more complex answer than I think you may have anticipated.
First off, I fear you have also forgotten to consider that timezones alone do not provide enough information to calculate day or night. You must also cross-reference that with a latitude reference because the duration of day and night vary across that.
A helpful lead, from another answer on Stack Overflow with similar credentials: https://stackoverflow.com/a/15044683/60318
A concise description of an algorithm to calculate the sunrise and
sunset is provided by the United States Naval Observatory, available
here:
http://edwilliams.org/sunrise_sunset_algorithm.htm
In addition to providing the date and location, you also need to
select a Zenith angle (at which the sun will be considered to have
"risen" or "set") - the page linked has several options.
This would still need to be built into a function, but perhaps if you are clever with looking for gists on github you might find something helpful.
There is a sunrise/sunset calculator found here: https://gml.noaa.gov/grad/solcalc/sunrise.html
You can get an idea of cross-referencing the user's location with the timezones, and I think you will have a more complete solution.