ObjFW
src/OFDate.h
00001 /*
00002  * Copyright (c) 2008, 2009, 2010, 2011
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 
00019 @class OFString;
00020 
00024 @interface OFDate: OFObject <OFCopying, OFComparing>
00025 {
00026         int64_t sec;
00027         uint32_t usec;
00028 }
00029 
00033 + date;
00034 
00039 + dateWithTimeIntervalSince1970: (int64_t)sec;
00040 
00046 + dateWithTimeIntervalSince1970: (int64_t)sec
00047                    microseconds: (uint32_t)usec;
00048 
00053 + dateWithTimeIntervalSinceNow: (int64_t)sec;
00054 
00060 + dateWithTimeIntervalSinceNow: (int64_t)sec
00061                   microseconds: (uint32_t)usec;
00062 
00068 + distantFuture;
00069 
00075 + distantPast;
00076 
00083 - initWithTimeIntervalSince1970: (int64_t)sec;
00084 
00092 - initWithTimeIntervalSince1970: (int64_t)sec
00093                    microseconds: (uint32_t)usec;
00094 
00102 - initWithTimeIntervalSinceNow: (int64_t)sec;
00103 
00111 - initWithTimeIntervalSinceNow: (int64_t)sec
00112                   microseconds: (uint32_t)usec;
00113 
00117 - (uint32_t)microsecond;
00118 
00122 - (uint8_t)second;
00123 
00127 - (uint8_t)minute;
00128 
00132 - (uint8_t)hour;
00133 
00137 - (uint8_t)localHour;
00138 
00142 - (uint8_t)dayOfMonth;
00143 
00147 - (uint8_t)localDayOfMonth;
00148 
00152 - (uint8_t)monthOfYear;
00153 
00157 - (uint8_t)localMonthOfYear;
00158 
00162 - (uint16_t)year;
00163 
00167 - (uint8_t)dayOfWeek;
00168 
00172 - (uint8_t)localDayOfWeek;
00173 
00177 - (uint16_t)dayOfYear;
00178 
00182 - (uint16_t)localDayOfYear;
00183 
00192 - (OFString*)dateStringWithFormat: (OFString*)fmt;
00193 
00202 - (OFString*)localDateStringWithFormat: (OFString*)fmt;
00203 
00208 - (OFDate*)earlierDate: (OFDate*)date;
00209 
00214 - (OFDate*)laterDate: (OFDate*)date;
00215 
00219 - (int64_t)timeIntervalSince1970;
00220 
00224 - (uint32_t)microsecondsOfTimeIntervalSince1970;
00225 
00229 - (int64_t)timeIntervalSinceDate: (OFDate*)date;
00230 
00234 - (uint32_t)microsecondsOfTimeIntervalSinceDate: (OFDate*)date;
00235 
00242 - (OFDate*)dateByAddingTimeInterval: (int64_t)sec;
00243 
00251 - (OFDate*)dateByAddingTimeInterval: (int64_t)sec
00252                    withMicroseconds: (uint32_t)usec;
00253 @end
 All Classes Functions Variables