ObjFW
|
00001 /* 00002 * Copyright (c) 2008, 2009, 2010, 2011, 2012 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in 00009 * the packaging of this file. 00010 * 00011 * Alternatively, it may be distributed under the terms of the GNU General 00012 * Public License, either version 2 or 3, which can be found in the file 00013 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this 00014 * file. 00015 */ 00016 00017 #import "OFObject.h" 00018 #import "OFSerialization.h" 00019 00020 @class OFString; 00021 @class OFConstantString; 00022 00026 @interface OFDate: OFObject <OFCopying, OFComparing, OFSerialization> 00027 { 00028 double seconds; 00029 } 00030 00036 + date; 00037 00045 + dateWithTimeIntervalSince1970: (double)seconds; 00046 00053 + dateWithTimeIntervalSinceNow: (double)seconds; 00054 00072 + dateWithDateString: (OFString*)string 00073 format: (OFString*)format; 00074 00090 + dateWithLocalDateString: (OFString*)string 00091 format: (OFString*)format; 00092 00100 + distantFuture; 00101 00109 + distantPast; 00110 00118 - initWithTimeIntervalSince1970: (double)seconds; 00119 00127 - initWithTimeIntervalSinceNow: (double)seconds; 00128 00146 - initWithDateString: (OFString*)string 00147 format: (OFString*)format; 00148 00164 - initWithLocalDateString: (OFString*)string 00165 format: (OFString*)format; 00166 00172 - (uint32_t)microsecond; 00173 00179 - (uint8_t)second; 00180 00186 - (uint8_t)minute; 00187 00193 - (uint8_t)hour; 00194 00200 - (uint8_t)localHour; 00201 00207 - (uint8_t)dayOfMonth; 00208 00214 - (uint8_t)localDayOfMonth; 00215 00221 - (uint8_t)monthOfYear; 00222 00228 - (uint8_t)localMonthOfYear; 00229 00235 - (uint16_t)year; 00236 00242 - (uint16_t)localYear; 00243 00249 - (uint8_t)dayOfWeek; 00250 00256 - (uint8_t)localDayOfWeek; 00257 00263 - (uint16_t)dayOfYear; 00264 00270 - (uint16_t)localDayOfYear; 00271 00280 - (OFString*)dateStringWithFormat: (OFConstantString*)format; 00281 00290 - (OFString*)localDateStringWithFormat: (OFConstantString*)format; 00291 00298 - (OFDate*)earlierDate: (OFDate*)otherDate; 00299 00306 - (OFDate*)laterDate: (OFDate*)otherDate; 00307 00313 - (double)timeIntervalSince1970; 00314 00321 - (double)timeIntervalSinceDate: (OFDate*)otherDate; 00322 00328 - (double)timeIntervalSinceNow; 00329 00336 - (OFDate*)dateByAddingTimeInterval: (double)seconds; 00337 @end