1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_DATETIME_H_
3 # define _GNM_DATETIME_H_
7 #include <goffice/goffice.h>
11 gboolean
gnm_datetime_allow_negative (void);
13 gnm_float
datetime_value_to_serial_raw (GnmValue
const *v
, GODateConventions
const *conv
);
14 int datetime_value_to_seconds (GnmValue
const *v
, GODateConventions
const *conv
);
16 /* These are date-only, no time. */
17 gboolean
datetime_value_to_g (GDate
*res
, GnmValue
const *v
, GODateConventions
const *conv
);
18 int datetime_value_to_serial (GnmValue
const *v
, GODateConventions
const *conv
);
20 int annual_year_basis (GnmValue
const *value_date
, GOBasisType basis
,
21 GODateConventions
const *date_conv
);
22 gnm_float
yearfrac (GDate
const *from
, GDate
const *to
, GOBasisType basis
);
24 void gnm_date_add_days (GDate
*d
, int n
);
25 void gnm_date_add_months (GDate
*d
, int n
);
26 void gnm_date_add_years (GDate
*d
, int n
);
28 #define GNM_DATE_BASIS_HELP \
29 { GNM_FUNC_HELP_NOTE, F_("If @{basis} is 0, then the US 30/360 method is used.") }, \
30 { GNM_FUNC_HELP_NOTE, F_("If @{basis} is 1, then actual number of days is used.") }, \
31 { GNM_FUNC_HELP_NOTE, F_("If @{basis} is 2, then actual number of days is used within a month, but years are considered only 360 days.") }, \
32 { GNM_FUNC_HELP_NOTE, F_("If @{basis} is 3, then actual number of days is used within a month, but years are always considered 365 days.") }, \
33 { GNM_FUNC_HELP_NOTE, F_("If @{basis} is 4, then the European 30/360 method is used.") },
38 #endif /* _GNM_DATETIME_H_ */