after i get current device time by using [NSDate date], how do i know it’s daytime or night now?
thanks in advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.