objc

NXDate.h
Go to the documentation of this file.
1 
9 #pragma once
10 #include "NXTimeInterval.h"
11 #include <runtime-sys/sys.h>
12 
22 @interface NXDate : NXObject <JSONProtocol> {
23 @protected
25 @private
26  uint16_t _year;
27  uint8_t _month;
28  uint8_t _day;
29  uint8_t _weekday;
30  uint8_t _hours;
31  uint8_t _minutes;
32  uint8_t _seconds;
33 }
34 
36 // LIFECYCLE
37 
42 + (NXDate *)date;
43 
51 + (NXDate *)dateWithTimeIntervalSinceNow:(NXTimeInterval)interval;
52 
54 // PROPERTIES
55 
67 - (BOOL)year:(uint16_t *)year
68  month:(uint8_t *)month
69  day:(uint8_t *)day
70  weekday:(uint8_t *)weekday;
71 
84 - (BOOL)hours:(uint8_t *)hours
85  minutes:(uint8_t *)minutes
86  seconds:(uint8_t *)seconds
87  nanoseconds:(uint32_t *)nanoseconds;
88 
99 - (BOOL)setYear:(uint16_t)year month:(uint8_t)month day:(uint8_t)day;
100 
113 - (BOOL)setHours:(uint8_t)hours
114  minutes:(uint8_t)minutes
115  seconds:(uint8_t)seconds
116  nanoseconds:(uint32_t)nanoseconds;
117 
124 - (NXTimeInterval)compare:(NXDate *)otherDate;
125 
131 - (BOOL)isEarlierThan:(NXDate *)otherDate;
132 
138 - (BOOL)isLaterThan:(NXDate *)otherDate;
139 
144 - (void)addTimeInterval:(NXTimeInterval)interval;
145 
152 - (NXDate *)dateByAddingTimeInterval:(NXTimeInterval)interval;
153 
154 @end
System management functions.
A class for representing and manipulating dates.
Definition: NXDate.h:22
int64_t NXTimeInterval
Time interval type representing nanoseconds as a 64-bit signed integer.
bool BOOL
A Boolean value.
Definition: runtime.h:60
NXDate * date()
Creates and returns a new date set to the current date and time.
The base class for objects in the Foundation framework.
Definition: NXObject.h:21
Time interval type and constants for duration measurements.
Represents a system date and time structure.
Definition: date.h:45
A protocol that defines JSON methods for an Object.
Definition: JSON+Protocol.h:14
sys_date_t _date
Date and time representation.
Definition: NXDate.h:24