-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsupport.h
55 lines (39 loc) · 1.57 KB
/
support.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef __CALENDAR_SUPPORT_H__
#define __CALENDAR_SUPPORT_H__
#include <stdbool.h>
#define COUNT_OF(element) (sizeof(element) / sizeof(element[0]))
typedef struct tagWzDayTime
{
int year;
int month;
int day;
int hour;
int minute;
double second;
}WZDAYTIME;
bool IsLeapYear(int year);
bool IsGregorianDays(int year, int month, int day);
int GetDaysOfMonth(int year, int month);
int CalcYearRestDays(int year, int month, int day);
int CalcYearPassedDays(int year, int month, int day);
int CalcYearsDays(int years, int yeare);
int CalculateDays(int ys, int ms, int ds, int ye, int me, int de);
int ZellerWeek(int year, int month, int day);
int TotalWeek(int year, int month, int day);
double CalculateJulianDay(int year, int month, int day, int hour, int minute, double second);
double CalculateJulianDay2(WZDAYTIME *pDT);
void GetDayTimeFromJulianDay(double jd, WZDAYTIME *pDT);
void UTCToLocalTime(int *year, int *month, int *day, int *hour, int *minute, double *second);
void LocalTimetoUTC(int *year, int *month, int *day, int *hour, int *minute, double *second);
double JDUTCToLocalTime(double utcJD);
double JDLocalTimetoUTC(double localJD);
double JDUTCtoTD(double utcJD);
double JDTDtoUTC(double tdJD);
double JDLocalTimetoTD(double localJD);
double JDTDtoLocalTime(double tdJD);
double RadianToDegree(double radian);
double DegreeToRadian(double degree);
// µ÷Õû½Ç¶Èµ½ 0-360 Ö®¼ä
double Mod360Degree(double degrees);
int JDtoString(double jd, char *strBuf, int bufSize);
#endif //__CALENDAR_SUPPORT_H__