Skip to content

Instantly share code, notes, and snippets.

View andykorth's full-sized avatar

Andy Korth andykorth

View GitHub Profile
@jonswaff
jonswaff / timeIntervalToStringWithInterval
Created July 27, 2012 02:23
Convert a NSTimeInterval into a human-readable string. Used to convert EKAlerts to text
+ (NSString *)timeIntervalToStringWithInterval:(NSTimeInterval)interval
{
NSString *retVal = @"At time of event";
if (interval == 0) return retVal;
int second = 1;
int minute = second*60;
int hour = minute*60;
int day = hour*24;
// interval can be before (negative) or after (positive)