GNUstep CoreBase Library 0.2
CFDate.h
1/* CFDate.h
2
3 Copyright (C) 2010 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: January, 2010
7
8 This file is part of GNUstep CoreBase Library.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, see <http://www.gnu.org/licenses/> or write to the
23 Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef __COREFOUNDATION_CFDATE_H__
28#define __COREFOUNDATION_CFDATE_H__
29
30#include <CoreFoundation/CFBase.h>
31
32CF_EXTERN_C_BEGIN
33
35typedef const struct __CFDate *CFDateRef;
37typedef const struct __CFTimeZone *CFTimeZoneRef;
38
45typedef double CFTimeInterval;
46typedef CFTimeInterval CFAbsoluteTime;
47
48typedef struct CFGregorianDate CFGregorianDate;
50{
51 SInt32 year;
52 SInt8 month;
53 SInt8 day;
54 SInt8 hour;
55 SInt8 minute;
56 double second;
57};
58
61{
62 SInt32 years;
63 SInt32 months;
64 SInt32 days;
65 SInt32 hours;
66 SInt32 minutes;
67 double seconds;
68};
69
70typedef enum
71{
72 kCFGregorianUnitsYears = (1 << 0),
73 kCFGregorianUnitsMonths = (1 << 1),
74 kCFGregorianUnitsDays = (1 << 2),
75 kCFGregorianUnitsHours = (1 << 3),
76 kCFGregorianUnitsMinutes = (1 << 4),
77 kCFGregorianUnitsSeconds = (1 << 5),
78 kCFGregorianAllUnits = 0x00FFFFFF
79} CFGregorianUnitFlags;
85CF_EXPORT const CFTimeInterval kCFAbsoluteTimeIntervalSince1970;
86CF_EXPORT const CFTimeInterval kCFAbsoluteTimeIntervalSince1904;
92CF_EXPORT CFAbsoluteTime
93CFAbsoluteTimeAddGregorianUnits (CFAbsoluteTime at, CFTimeZoneRef tz,
94 CFGregorianUnits units);
95
96CF_EXPORT CFAbsoluteTime CFAbsoluteTimeGetCurrent (void);
97
98CF_EXPORT SInt32
99CFAbsoluteTimeGetDayOfWeek (CFAbsoluteTime at, CFTimeZoneRef tz);
100
101CF_EXPORT SInt32
102CFAbsoluteTimeGetDayOfYear (CFAbsoluteTime at, CFTimeZoneRef tz);
103
104CF_EXPORT CFGregorianUnits
105CFAbsoluteTimeGetDifferenceAsGregorianUnits (CFAbsoluteTime at1,
106 CFAbsoluteTime at2,
107 CFTimeZoneRef tz,
108 CFOptionFlags unitFlags);
109
110CF_EXPORT CFGregorianDate
111CFAbsoluteTimeGetGregorianDate (CFAbsoluteTime at, CFTimeZoneRef tz);
112
113CF_EXPORT SInt32
114CFAbsoluteTimeGetWeekOfYear (CFAbsoluteTime at, CFTimeZoneRef tz);
115
116CF_EXPORT CFAbsoluteTime
117CFGregorianDateGetAbsoluteTime (CFGregorianDate gdate, CFTimeZoneRef tz);
118
119CF_EXPORT Boolean
120CFGregorianDateIsValid (CFGregorianDate gdate, CFOptionFlags unitFlags);
130CF_EXPORT CFComparisonResult
131CFDateCompare (CFDateRef theDate, CFDateRef otherDate, void *context);
132
133CF_EXPORT CFDateRef CFDateCreate (CFAllocatorRef allocator, CFAbsoluteTime at);
134
135CF_EXPORT CFAbsoluteTime CFDateGetAbsoluteTime (CFDateRef theDate);
136
137CF_EXPORT CFTimeInterval
138CFDateGetTimeIntervalSinceDate (CFDateRef theDate, CFDateRef otherDate);
139
140CF_EXPORT CFTypeID CFDateGetTypeID (void);
144CF_EXTERN_C_END
145#endif /* __COREFOUNDATION_CFDATE_H__ */
unsigned long CFOptionFlags
Definition CFBase.h:163
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301
Definition CFDate.h:50
Definition CFDate.h:61