diff -r 3d3dcc3116d5 -r 5588347dfcbd DateUtils.m --- a/DateUtils.m Wed Apr 02 14:45:33 2008 -0700 +++ b/DateUtils.m Wed May 07 16:47:44 2008 -0700 @@ -15,6 +15,22 @@ #include +/** Absolute time (since 'reference date') to NSDate. 0.0 -> nil. */ +NSDate* $date( CFAbsoluteTime time ) +{ + CAssert(time>=0.0 && time < 1.0e15, @"Bogus timestamp %g",time); + return time ?[NSDate dateWithTimeIntervalSinceReferenceDate: time] :nil; +} + + +/** NSDate to absolute time (since 'reference date'). nil -> 0.0 */ +CFAbsoluteTime $time( NSDate* date ) +{ + return date ?[date timeIntervalSinceReferenceDate] :0.0; +} + + + NSTimeInterval TimeIntervalSinceBoot(void) { // From http://developer.apple.com/qa/qa2004/qa1398.html