Hi I am trying to check if the current time is within a time range, say 8:00 - 16:30. My code below shows that I can obtain the current time as a string, but I am unsure how
Here is some code I use in one of my current projects. Just set start time as 8:00, end time as 16:30, and timeStamp as current time.
func isTimeStampCurrent(timeStamp:NSDate, startTime:NSDate, endTime:NSDate)->Bool{
timeStamp.earlierDate(endTime) == timeStamp && timeStamp.laterDate(startTime) == timeStamp
}