FireBirdLib - Topfield TMS PVR TAP Programming Library
AddTime.c
Go to the documentation of this file.
1
#include "
libFireBird.h
"
2
3
dword
AddTime
(dword date,
int
add)
//add minutes to the day
4
{
5
TRACEENTER
();
6
7
word day;
8
short
hour, min;
9
10
day = (date >> 16) & 0xffff;
11
hour= (date >> 8) & 0xff;
12
min = (date) & 0xff;
13
14
min += add % 60;
15
if
(min < 0)
16
{
17
hour-=1;
18
min+=60;
19
}
20
else
if
(min > 59)
21
{
22
hour+=1;
23
min-=60;
24
}
25
26
hour += add / 60;
27
28
if
(hour < 0)
29
{
30
day-=1;
31
hour+=24;
32
}
33
else
34
{
35
while
(hour > 23)
36
{
37
day+=1;
38
hour-=24;
39
}
40
}
41
42
TRACEEXIT
();
43
return
((day<<16)|(hour<<8)|min);
44
}
AddTime
dword AddTime(dword date, int add)
Definition:
AddTime.c:3
libFireBird.h
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
time
AddTime.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3