Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kDateTime.h
Go to the documentation of this file.
1
10 #ifndef K_API_DATE_TIME_H
11 #define K_API_DATE_TIME_H
12
13 #include <kApi/kApiDef.h>
14
21 typedef k32s kDateTimeFormat;
22
24 #define kDATE_TIME_FORMAT_NULL (0)
25 #define kDATE_TIME_FORMAT_FULL (1)
26 #define kDATE_TIME_FORMAT_SIMPLE (2)
27 #define kDATE_TIME_FORMAT_LOCAL (3)
28 #define kDATE_TIME_FORMAT_ISO_8601 (4)
29
65 typedef k64s kDateTime;
66
67 //A few well-known epochs, expressed as kDateTime values.
68 #define kDATE_TIME_EPOCH_UNIX (0x00DCBFFEFF2BC000)
69 #define kDATE_TIME_EPOCH_NTP (0x00D4E6EEB66F2000)
70 #define kDATE_TIME_EPOCH_WINDOWS (0x00B36168B6A58000)
71
72 #include <kApi/Utils/kDateTime.x.h>
73
86 kFx(kDateTime) kDateTime_Now();
87
107 kFx(kStatus) kDateTime_LocalParts(kDateTime dateTime, k32s* year, k32s* month, k32s* day, k32s* dayOfWeek, k32s* hour, k32s* minute, k32s* second, k32s* microsecond, k32s* utcOffset);
108
127 kFx(kStatus) kDateTime_FromLocalParts(kDateTime* dateTime, k32s year, k32s month, k32s day, k32s hour, k32s minute, k32s second, k32s microsecond, k32s utcOffset);
128
139 kFx(kStatus) kDateTime_Format(kDateTime dateTime, kDateTimeFormat format, kChar* text, kSize capacity);
140
154 kFx(kStatus) kDateTime_Parse(kDateTime* dateTime, kDateTimeFormat format, const kChar* text);
155
156 #endif
kDateTime::kDateTime_FromLocalParts
kStatus kDateTime_FromLocalParts(kDateTime *dateTime, k32s year, k32s month, k32s day, k32s hour, k32s minute, k32s second, k32s microsecond, k32s utcOffset)
Gets the date-time value associated with the specified broken-down local time parts.
kSize
Represents an unsigned integer that can store a pointer address.
kChar
Represents a single unit (byte) in a UTF-8 character.
kDateTime::kDateTime_Format
kStatus kDateTime_Format(kDateTime dateTime, kDateTimeFormat format, kChar *text, kSize capacity)
Formats a date-time value as a string.
kApiDef.h
Core Zen type declarations.
k32s
Represents a 32-bit signed integer.
kDateTime::kDateTime_Now
kDateTime kDateTime_Now()
Gets the current calendar date-time.
kDateTime::kDateTime_LocalParts
kStatus kDateTime_LocalParts(kDateTime dateTime, k32s *year, k32s *month, k32s *day, k32s *dayOfWeek, k32s *hour, k32s *minute, k32s *second, k32s *microsecond, k32s *utcOffset)
Gets the broken-down local time associated with a date-time value.
kStatus
Represents an error code.
kDateTime
Represents UTC calendar date/time.
kDateTime::kDateTime_Parse
kStatus kDateTime_Parse(kDateTime *dateTime, kDateTimeFormat format, const kChar *text)
Parses a time string that was formatted with kDateTime_Format.
kDateTimeFormat
Represents a date/time text format.