author | truebrain |
Mon, 30 Jun 2008 13:36:06 +0000 | |
branch | noai |
changeset 11100 | b960288098b9 |
parent 11044 | 097ea3e7ec56 |
permissions | -rw-r--r-- |
9723 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file date_func.h Functions related to dates. */ |
|
4 |
||
5 |
#ifndef DATE_FUNC_H |
|
6 |
#define DATE_FUNC_H |
|
7 |
||
8 |
#include "date_type.h" |
|
9 |
||
10 |
extern Year _cur_year; |
|
11 |
extern Month _cur_month; |
|
12 |
extern Date _date; |
|
13 |
extern DateFract _date_fract; |
|
14 |
||
15 |
void SetDate(Date date); |
|
16 |
void ConvertDateToYMD(Date date, YearMonthDay *ymd); |
|
17 |
Date ConvertYMDToDate(Year year, Month month, Day day); |
|
18 |
||
11044
097ea3e7ec56
(svn r13600) [NoAI] -Sync: with trunk r13508:13599.
rubidium
parents:
9723
diff
changeset
|
19 |
static inline bool IsLeapYear(Year yr) |
097ea3e7ec56
(svn r13600) [NoAI] -Sync: with trunk r13508:13599.
rubidium
parents:
9723
diff
changeset
|
20 |
{ |
097ea3e7ec56
(svn r13600) [NoAI] -Sync: with trunk r13508:13599.
rubidium
parents:
9723
diff
changeset
|
21 |
return yr % 4 == 0 && (yr % 100 != 0 || yr % 400 == 0); |
097ea3e7ec56
(svn r13600) [NoAI] -Sync: with trunk r13508:13599.
rubidium
parents:
9723
diff
changeset
|
22 |
} |
097ea3e7ec56
(svn r13600) [NoAI] -Sync: with trunk r13508:13599.
rubidium
parents:
9723
diff
changeset
|
23 |
|
9723 | 24 |
#endif /* DATE_FUNC_H */ |