NxDate Usage
The struct NxDate is a member of 3 structures in NxCoreAPI:
NxDate
NxDate is defined in NxCoreAPI.h as:
struct NxDate { unsigned long NDays; unsigned short Year; unsigned char Month; unsigned char Day; unsigned char DSTIndicator; unsigned char DayOfWeek; unsigned short DayOfYear; };
NxDate members
Member | Type | Min | Max | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NDays | unsigned long | 0 | 93503 | NDays represents the number of calendar days since Jan 1, 1883. Although defined as an unsigned long, the maximum value for NDays is currently set to 93,503 which spans to Dec 31, 2138 (255 years). When it becomes necessary to address dates beyond 2138, the function will simply be updated. | ||||||||||||||||||||||||
Year | unsigned short | 1883 | 2138 | Year represents the current year on the Gregorian calendar, for example: 2003, 2004, etc. | ||||||||||||||||||||||||
Month | unsigned char | 1 | 12 | Current month of the Calendar year, with January equal to 1, February equal to 2, .. December equal to 12. | ||||||||||||||||||||||||
Day | unsigned char | 1 | 31 | Current day of the Calendar month ranging from 1 to 31. | ||||||||||||||||||||||||
DSTIndicator | unsigned char | 0 | 5 | Daylight Savings Indicator.
|
||||||||||||||||||||||||
DayOfWeek | unsigned char | 0 | 6 | Day of Week
|
||||||||||||||||||||||||
DayOfYear | unsigned short | 1 | 365 | Count of days since January 1st. Useful in determining end of quarter. |
Example
For example of date manipulation see here and here