gnm-datetime.h 955 Bytes
Newer Older
1 2 3
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef _GNM_DATETIME_H_
# define _GNM_DATETIME_H_
4 5

#include "gnumeric.h"
Morten Welinder's avatar
Morten Welinder committed
6
#include "numbers.h"
7 8 9 10
#include <goffice/utils/datetime.h>

G_BEGIN_DECLS

11 12
gboolean gnm_datetime_allow_negative (void);

Morten Welinder's avatar
Morten Welinder committed
13
gnm_float datetime_value_to_serial_raw (GnmValue const *v, GODateConventions const *conv);
14 15 16 17 18 19 20 21 22

/* These are date-only, no time.  */
gboolean datetime_value_to_g		(GDate *res, GnmValue const *v, GODateConventions const *conv);
int      datetime_value_to_serial	(GnmValue const *v, GODateConventions const *conv);

int     annual_year_basis  (GnmValue const *value_date, basis_t basis,
			    GODateConventions const *date_conv);
gnm_float yearfrac (GDate const *from, GDate const *to, basis_t basis);

Morten Welinder's avatar
Morten Welinder committed
23 24 25
void gnm_date_add_days (GDate *d, int n);
void gnm_date_add_months (GDate *d, int n);
void gnm_date_add_years (GDate *d, int n);
26 27 28

G_END_DECLS

29
#endif /* _GNM_DATETIME_H_ */