FireBirdLib - Topfield TMS PVR TAP Programming Library
DST_GetTransitions_Europe.c
Go to the documentation of this file.
1#include "FBLib_time.h"
2
3void DST_GetTransitions_Europe(dword *DSTStartUTC, dword *DSTEndUTC, dword StartDate)
4{
6
7 dword DSTStartLocal, DSTEndLocal;
8 short TZOffset;
9
10 //DST starts at the last Sunday in March, 02:00 local
11 DSTStartLocal = DST_CalcTransition(5, 6, 3, 2, 0, StartDate);
12
13 //DST ends at the last Sunday in October, 03:00 local
14 DSTEndLocal = DST_CalcTransition(5, 6, 10, 3, 0, StartDate);
15
16 //Get the Toppy's standard time zone
17 GetCurrentTimeZone(&TZOffset, NULL);
18
19 //Convert from local to UTC times
20 if(DSTStartUTC) *DSTStartUTC = AddTime(DSTStartLocal, -TZOffset);
21 if(DSTEndUTC) *DSTEndUTC = AddTime(DSTEndLocal, -TZOffset);
22
23 TRACEEXIT();
24}
void DST_GetTransitions_Europe(dword *DSTStartUTC, dword *DSTEndUTC, dword StartDate)
dword AddTime(dword pvrDate, int addMinutes)
Definition: AddTime.c:3
dword DST_CalcTransition(byte ruleOrdinal, byte ruleDay, byte ruleMonth, byte ruleHour, byte ruleMin, dword StartDate)
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
bool GetCurrentTimeZone(short *TZOffset, bool *DST)