libnova  v 0.16.0
julian_day.h
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  *
16  * Copyright (C) 2000 - 2005 Liam Girdwood
17  */
18 
19 #ifndef _LN_JULIAN_DAY_H
20 #define _LN_JULIAN_DAY_H
21 
22 #include <time.h>
23 #include <libnova/ln_types.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
36 double LIBNOVA_EXPORT ln_get_julian_day(struct ln_date *date);
37 
42 void LIBNOVA_EXPORT ln_get_date(double JD, struct ln_date *date);
43 
48 void LIBNOVA_EXPORT ln_get_date_from_timet (time_t *t, struct ln_date *date);
49 
54 void LIBNOVA_EXPORT ln_get_date_from_tm(struct tm *t, struct ln_date *date);
55 
60 void LIBNOVA_EXPORT ln_get_local_date(double JD, struct ln_zonedate *zonedate);
61 
66 unsigned int LIBNOVA_EXPORT ln_get_day_of_week(struct ln_date *date);
67 
72 double LIBNOVA_EXPORT ln_get_julian_from_sys();
73 
74 
79 void LIBNOVA_EXPORT ln_get_date_from_sys(struct ln_date *date);
80 
85 double LIBNOVA_EXPORT ln_get_julian_from_timet(time_t * in_time);
86 
91 void LIBNOVA_EXPORT ln_get_timet_from_julian(double JD, time_t * in_time);
92 
97 double LIBNOVA_EXPORT ln_get_julian_local_date(struct ln_zonedate* zonedate);
98 
103 int LIBNOVA_EXPORT ln_get_date_from_mpc(struct ln_date *date, char *mpc_date);
104 
109 double LIBNOVA_EXPORT ln_get_julian_from_mpc(char *mpc_date);
110 
115 void LIBNOVA_EXPORT ln_date_to_zonedate(struct ln_date *date,
116  struct ln_zonedate *zonedate, long gmtoff);
117 
122 void LIBNOVA_EXPORT ln_zonedate_to_date(struct ln_zonedate *zonedate,
123  struct ln_date *date);
124 
125 #ifdef __cplusplus
126 };
127 #endif
128 
129 #endif
void LIBNOVA_EXPORT ln_get_timet_from_julian(double JD, time_t *in_time)
Calculate time_t from julian day.
Definition: julian_day.c:246
Human readable Date and time with timezone information used by libnova.
Definition: ln_types.h:98
void LIBNOVA_EXPORT ln_date_to_zonedate(struct ln_date *date, struct ln_zonedate *zonedate, long gmtoff)
convert ln_date to ln_zonedate, zero zone info
Definition: julian_day.c:396
unsigned int LIBNOVA_EXPORT ln_get_day_of_week(struct ln_date *date)
Calculate day of the week.
Definition: julian_day.c:95
void LIBNOVA_EXPORT ln_zonedate_to_date(struct ln_zonedate *zonedate, struct ln_date *date)
convert ln_zonedate to ln_date
Definition: julian_day.c:422
double LIBNOVA_EXPORT ln_get_julian_day(struct ln_date *date)
Calculate the julian day from date.
Definition: julian_day.c:45
void LIBNOVA_EXPORT ln_get_date(double JD, struct ln_date *date)
Calculate the date from the julian day.
Definition: julian_day.c:114
double LIBNOVA_EXPORT ln_get_julian_from_sys()
Calculate julian day from system time.
Definition: julian_day.c:256
void LIBNOVA_EXPORT ln_get_date_from_sys(struct ln_date *date)
Calculate date from system date.
Definition: julian_day.c:196
int LIBNOVA_EXPORT ln_get_date_from_mpc(struct ln_date *date, char *mpc_date)
Calculate the local date from the a MPC packed date.
Definition: julian_day.c:323
Human readable Date and time used by libnova.
Definition: ln_types.h:79
double LIBNOVA_EXPORT ln_get_julian_from_timet(time_t *in_time)
Calculate julian day from time_t.
Definition: julian_day.c:224
double LIBNOVA_EXPORT ln_get_julian_local_date(struct ln_zonedate *zonedate)
Calculate Julian day from local date.
Definition: julian_day.c:274
double LIBNOVA_EXPORT ln_get_julian_from_mpc(char *mpc_date)
Calculate the julian day from the a MPC packed date.
Definition: julian_day.c:378