Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 21 lines (18 sloc) 0.503 kb
5cb504b @andersk * Split make_rst into rst.c.
andersk authored
1 #include <time.h>
2 #include "rst.h"
3
4 time_t (*o_mktime) (struct tm * tp) = &mktime;
5 struct tm * (*o_localtime_r) (const time_t * t, struct tm * tp) = &localtime_r;
6 struct tm * (*o_localtime) (const time_t * t) = &localtime;
7
8 void make_rst (struct tm * tp)
9 {
10 if(tp->tm_hour < 6) {
2067eb8 @andersk Return a correct tm_isdst value.
andersk authored
11 int hour = tp->tm_hour, min = tp->tm_min, sec = tp->tm_sec,
12 isdst = tp->tm_isdst;
5cb504b @andersk * Split make_rst into rst.c.
andersk authored
13 tp->tm_hour = -12;
14 o_mktime(tp);
15 tp->tm_hour = hour + 24;
16 tp->tm_min = min;
17 tp->tm_sec = sec;
2067eb8 @andersk Return a correct tm_isdst value.
andersk authored
18 tp->tm_isdst = isdst;
5cb504b @andersk * Split make_rst into rst.c.
andersk authored
19 }
20 }
Something went wrong with that request. Please try again.