75 #include <glib-object.h>
98 GType timespec_get_type(
void );
99 #define GNC_TYPE_TIMESPEC (timespec_get_type ())
106 #define MAX_DATE_LENGTH 34
118 #define QOF_UTC_DATE_FORMAT "%Y-%m-%dT%H:%M:%SZ"
132 #define DATE_FORMAT_FIRST QOF_DATE_FORMAT_US
133 #define DATE_FORMAT_LAST QOF_DATE_FORMAT_UTC
144 #define qof_date_format_get_format qof_date_text_format_get_string
152 GNCDATE_MONTH_NUMBER,
153 GNCDATE_MONTH_ABBREV,
239 gdouble
gnc_difftime (
const time64 secs1,
const time64 secs2);
511 gsize
qof_strftime(gchar *buf, gsize max,
const gchar *format,
512 const struct tm *tm);
572 gboolean
qof_scan_date (
const char *buff,
int *day,
int *month,
int *year);
585 void gnc_tm_set_day_start (
struct tm *tm)
588 g_return_if_fail (tm != NULL);
600 void gnc_tm_set_day_middle (
struct tm *tm)
603 g_return_if_fail (tm != NULL);
615 void gnc_tm_set_day_end (
struct tm *tm)
618 g_return_if_fail (tm != NULL);
663 #define MIN_BUF_LEN 10
time64 gnc_time64_get_today_start(void)
gchar * gnc_timespec_to_iso8601_buff(Timespec ts, gchar *buff)
time64 timespecToTime64(Timespec ts)
const char * gnc_print_date(Timespec ts)
gboolean gnc_date_string_to_monthformat(const gchar *format_string, GNCDateMonthFormat *format)
Converts the month format to a printable string.
const gchar * gnc_date_dateformat_to_string(QofDateFormat format)
The string->value versions return FALSE on success and TRUE on failure.
time64 gnc_time64_get_today_end(void)
const gchar * qof_date_text_format_get_string(QofDateFormat df)
Timespec timespecCanonicalDayTime(Timespec t)
glong gnc_timezone(const struct tm *tm)
Timespec gnc_dmy2timespec_end(gint day, gint month, gint year)
gboolean timespec_equal(const Timespec *ta, const Timespec *tb)
Use a 64-bit unsigned int timespec.
GDateTime * gnc_g_date_time_new_from_unix_local(time64 time)
gchar dateSeparator(void)
void gnc_dow_abbrev(gchar *buf, int buf_len, int dow)
const char * gnc_default_strftime_date_format
Timespec gnc_dmy2timespec(gint day, gint month, gint year)
struct tm * gnc_localtime_r(const time64 *secs, struct tm *time)
fill out a time struct from a 64-bit time value adjusted for the current time zone.
Timespec timespec_abs(const Timespec *t)
void gnc_tm_free(struct tm *time)
free a struct tm* created with gnc_localtime() or gnc_gmtime()
char * qof_print_date(time64 secs)
gint timespec_cmp(const Timespec *ta, const Timespec *tb)
GDate timespec_to_gdate(Timespec ts)
void qof_date_completion_set(QofDateCompletion dc, int backmonths)
time64 gnc_time64_get_day_end(time64 time_val)
const gchar * qof_date_format_get_string(QofDateFormat df)
time64 gnc_mktime(struct tm *time)
calculate seconds from the epoch given a time struct
int gnc_date_get_last_mday(int month, int year)
gsize qof_strftime(gchar *buf, gsize max, const gchar *format, const struct tm *tm)
time64 gnc_timegm(struct tm *time)
calculate seconds from the epoch given a time struct
struct tm * gnc_localtime(const time64 *secs)
fill out a time struct from a 64-bit time value.
Timespec gnc_iso8601_to_timespec_gmt(const gchar *)
gdouble gnc_difftime(const time64 secs1, const time64 secs2)
Find the difference in seconds between two time values.
GDateTime * gnc_g_date_time_new_from_timespec_local(Timespec tm)
Create a GDateTime from a Timespec.
void gnc_tm_get_today_start(struct tm *tm)
time64 gnc_time64_get_day_start(time64 time_val)
Timespec timespec_diff(const Timespec *ta, const Timespec *tb)
void gnc_tm_get_today_end(struct tm *tm)
size_t qof_print_date_dmy_buff(gchar *buff, size_t buflen, int day, int month, int year)
Timespec timespec_now(void)
time64 gnc_time_utc(time64 *tbuf)
get the current utc time
gboolean qof_scan_date(const char *buff, int *day, int *month, int *year)
QofDateFormat qof_date_format_get(void)
struct tm * gnc_gmtime(const time64 *secs)
fill out a time struct from a 64-bit time value
void qof_date_format_set(QofDateFormat df)
time64 gnc_time(time64 *tbuf)
get the current local time
Timespec gdate_to_timespec(GDate d)
size_t qof_print_date_buff(char *buff, size_t buflen, time64 secs)
gchar * gnc_ctime(const time64 *secs)
Return a string representation of a date from a 64-bit time value.
gboolean gnc_date_string_to_dateformat(const gchar *format_string, QofDateFormat *format)
Converts the date format to a printable string.
void gnc_timespec2dmy(Timespec ts, gint *day, gint *month, gint *year)
size_t qof_print_date_time_buff(char *buff, size_t len, time64 secs)
size_t qof_print_gdate(char *buf, size_t bufflen, const GDate *gd)
void timespecFromTime64(Timespec *ts, time64 t)
char * gnc_date_timestamp(void)
Make a timestamp in YYYYMMDDHHMMSS format.
GDate * gnc_g_date_new_today(void)