GnuCash 2.3.0
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

Date and Time handling routines. More...

#include <glib-object.h>
#include <time.h>

Go to the source code of this file.

Data Structures

struct  timespec64
 Use a 64-bit unsigned int timespec. More...

Defines

#define MAX_DATE_LENGTH   31
#define QOF_UTC_DATE_FORMAT   "%Y-%m-%dT%H:%M:%SZ"
 UTC date format string.
#define DATE_FORMAT_FIRST   QOF_DATE_FORMAT_US
#define DATE_FORMAT_LAST   QOF_DATE_FORMAT_LOCALE
#define qof_date_format_get_format   qof_date_text_format_get_string

Typedefs

typedef struct timespec64 Timespec

Enumerations

enum  QofDateFormat {
  QOF_DATE_FORMAT_US, QOF_DATE_FORMAT_UK, QOF_DATE_FORMAT_CE, QOF_DATE_FORMAT_ISO,
  QOF_DATE_FORMAT_UTC, QOF_DATE_FORMAT_LOCALE, QOF_DATE_FORMAT_CUSTOM
}
enum  QofDateCompletion { QOF_DATE_COMPLETION_THISYEAR, QOF_DATE_COMPLETION_SLIDING }
enum  GNCDateMonthFormat { GNCDATE_MONTH_NUMBER, GNCDATE_MONTH_ABBREV, GNCDATE_MONTH_NAME }

Functions

void qof_date_completion_set (QofDateCompletion dc, int backmonths)
gchar dateSeparator (void)
String / DateFormat conversion.
const gchar * gnc_date_dateformat_to_string (QofDateFormat format)
 The string->value versions return FALSE on success and TRUE on failure.
gboolean gnc_date_string_to_dateformat (const gchar *format_string, QofDateFormat *format)
 Converts the date format to a printable string.
const gchar * gnc_date_monthformat_to_string (GNCDateMonthFormat format)
gboolean gnc_date_string_to_monthformat (const gchar *format_string, GNCDateMonthFormat *format)
 Converts the month format to a printable string.
Timespec functions
gboolean timespec_equal (const Timespec *ta, const Timespec *tb)
gint timespec_cmp (const Timespec *ta, const Timespec *tb)
Timespec timespec_diff (const Timespec *ta, const Timespec *tb)
Timespec timespec_abs (const Timespec *t)
Timespec timespecCanonicalDayTime (Timespec t)
Timespec timespec_now (void)
void timespecFromTime_t (Timespec *ts, time_t t)
time_t timespecToTime_t (Timespec ts)
GDate * gnc_g_date_new_today (void)
GDate timespec_to_gdate (Timespec ts)
Timespec gdate_to_timespec (GDate d)
GDate gnc_dmy2gdate (gint day, gint month, gint year)
Timespec gnc_dmy2timespec (gint day, gint month, gint year)
Timespec gnc_dmy2timespec_end (gint day, gint month, gint year)
Timespec gnc_iso8601_to_timespec_gmt (const gchar *)
gchar * gnc_timespec_to_iso8601_buff (Timespec ts, gchar *buff)
void gnc_timespec2dmy (Timespec ts, gint *day, gint *month, gint *year)
glong gnc_timezone (const struct tm *tm)
QofDateFormat functions
QofDateFormat qof_date_format_get (void)
void qof_date_format_set (QofDateFormat df)
const gchar * qof_date_format_get_string (QofDateFormat df)
const gchar * qof_date_text_format_get_string (QofDateFormat df)
Date Printing/Scanning functions
gsize qof_strftime (gchar *buf, gsize max, const gchar *format, const struct tm *tm)
size_t qof_print_date_dmy_buff (gchar *buff, size_t buflen, int day, int month, int year)
size_t qof_print_date_buff (char *buff, size_t buflen, time_t secs)
size_t qof_print_gdate (char *buf, size_t bufflen, const GDate *gd)
char * qof_print_date (time_t secs)
const char * gnc_print_date (Timespec ts)
size_t qof_print_date_time_buff (char *buff, size_t len, time_t secs)
gboolean qof_scan_date (const char *buff, int *day, int *month, int *year)
gboolean qof_scan_date_secs (const char *buff, time_t *secs)
Date Start/End Adjustment routines

Given a time value, adjust it to be the beginning or end of that day.

time_t gnc_timet_get_day_start (time_t time_val)
time_t gnc_timet_get_day_end (time_t time_val)
int date_get_last_mday (const struct tm *tm)
gboolean date_is_last_mday (const struct tm *tm)
int gnc_date_my_last_mday (int month, int year)
int gnc_timespec_last_mday (Timespec ts)

Variables

const char * gnc_default_strftime_date_format

GValue

#define GNC_TYPE_TIMESPEC   (timespec_get_type ())
GType timespec_get_type (void)

Today's Date

#define MIN_BUF_LEN   10
void gnc_tm_get_today_start (struct tm *tm)
void gnc_tm_get_today_end (struct tm *tm)
time_t gnc_timet_get_today_start (void)
time_t gnc_timet_get_today_end (void)
char * xaccDateUtilGetStampNow (void)
void gnc_dow_abbrev (gchar *buf, int buf_len, int dow)

Detailed Description

Date and Time handling routines.

Definition in file gnc-date.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines