Progress..
This commit is contained in:
parent
b10b4a79d4
commit
0f1c0a755f
2 changed files with 19 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
#include "epoch.h"
|
||||||
|
|
||||||
|
int32_t dateTimeGetYear(DateTime *dt) {
|
||||||
|
return dt->year.year;
|
||||||
|
}
|
14
zone.c
14
zone.c
|
@ -31,3 +31,17 @@ void printTz(TimeZone *zone) {
|
||||||
printf("%.2u:%.2u", zone->offset->hours, zone->offset->minutes);
|
printf("%.2u:%.2u", zone->offset->hours, zone->offset->minutes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int64_t timezoneAsSeconds(TimeZone *tz) {
|
||||||
|
int64_t base;
|
||||||
|
|
||||||
|
switch (tz->tag) {
|
||||||
|
case Offset:
|
||||||
|
base = (int64_t)tz->offset->hours * SECONDS_PER_HOUR + (int64_t)tz->offset->minutes * 60;
|
||||||
|
switch (tz->offset->sign) {
|
||||||
|
case Negative: return -base;
|
||||||
|
default: return base;
|
||||||
|
}
|
||||||
|
default: return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue