Hi, after i get current device time by using [NSDate date], how do i know it's daytime or night now?
thanks in advance!
Hi, after i get current device time by using [NSDate date], how do i know it's daytime or night now?
thanks in advance!
To be absolutely certain, I'd use a weather API like Yahoo's weather. Send the current location to the API, and you'll get back some data that contains the sunset and sunrise times for that area.
If the current time is past the sunset time... blammo.