Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gdatetime.h File Reference
#include <glib/gtimezone.h>

Go to the source code of this file.

Macros

#define G_TIME_SPAN_DAY   (G_GINT64_CONSTANT (86400000000))
 
#define G_TIME_SPAN_HOUR   (G_GINT64_CONSTANT (3600000000))
 
#define G_TIME_SPAN_MINUTE   (G_GINT64_CONSTANT (60000000))
 
#define G_TIME_SPAN_SECOND   (G_GINT64_CONSTANT (1000000))
 
#define G_TIME_SPAN_MILLISECOND   (G_GINT64_CONSTANT (1000))
 

Typedefs

typedef gint64 GTimeSpan
 
typedef struct _GDateTime GDateTime
 

Functions

GLIB_AVAILABLE_IN_ALL void g_date_time_unref (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_ref (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_new_now (GTimeZone *tz)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_new_now_local (void)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_new_now_utc (void)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_new_from_unix_local (gint64 t)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_new_from_unix_utc (gint64 t)
 
GLIB_AVAILABLE_IN_2_80 GDateTimeg_date_time_new_from_unix_local_usec (gint64 usecs)
 
GLIB_AVAILABLE_IN_2_80 GDateTimeg_date_time_new_from_unix_utc_usec (gint64 usecs)
 
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GDateTimeg_date_time_new_from_timeval_local (const GTimeVal *tv)
 
GDateTimeg_date_time_new_from_timeval_utc (const GTimeVal *tv)
 
G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_2_56 GDateTimeg_date_time_new_from_iso8601 (const gchar *text, GTimeZone *default_tz)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_new (GTimeZone *tz, gint year, gint month, gint day, gint hour, gint minute, gdouble seconds)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_new_local (gint year, gint month, gint day, gint hour, gint minute, gdouble seconds)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_new_utc (gint year, gint month, gint day, gint hour, gint minute, gdouble seconds)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add (GDateTime *datetime, GTimeSpan timespan)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add_years (GDateTime *datetime, gint years)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add_months (GDateTime *datetime, gint months)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add_weeks (GDateTime *datetime, gint weeks)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add_days (GDateTime *datetime, gint days)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add_hours (GDateTime *datetime, gint hours)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add_minutes (GDateTime *datetime, gint minutes)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add_seconds (GDateTime *datetime, gdouble seconds)
 
GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTimeg_date_time_add_full (GDateTime *datetime, gint years, gint months, gint days, gint hours, gint minutes, gdouble seconds)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_compare (gconstpointer dt1, gconstpointer dt2)
 
GLIB_AVAILABLE_IN_ALL GTimeSpan g_date_time_difference (GDateTime *end, GDateTime *begin)
 
GLIB_AVAILABLE_IN_ALL guint g_date_time_hash (gconstpointer datetime)
 
GLIB_AVAILABLE_IN_ALL gboolean g_date_time_equal (gconstpointer dt1, gconstpointer dt2)
 
GLIB_AVAILABLE_IN_ALL void g_date_time_get_ymd (GDateTime *datetime, gint *year, gint *month, gint *day)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_year (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_month (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_day_of_month (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_week_numbering_year (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_week_of_year (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_day_of_week (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_day_of_year (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_hour (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_minute (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_second (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint g_date_time_get_microsecond (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gdouble g_date_time_get_seconds (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gint64 g_date_time_to_unix (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_2_80 gint64 g_date_time_to_unix_usec (GDateTime *datetime)
 
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gboolean g_date_time_to_timeval (GDateTime *datetime, GTimeVal *tv)
 
G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_ALL GTimeSpan g_date_time_get_utc_offset (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_2_58 GTimeZoneg_date_time_get_timezone (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL const gcharg_date_time_get_timezone_abbreviation (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gboolean g_date_time_is_daylight_savings (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_to_timezone (GDateTime *datetime, GTimeZone *tz)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_to_local (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL GDateTimeg_date_time_to_utc (GDateTime *datetime)
 
GLIB_AVAILABLE_IN_ALL gcharg_date_time_format (GDateTime *datetime, const gchar *format) G_GNUC_MALLOC
 
GLIB_AVAILABLE_IN_2_62 gcharg_date_time_format_iso8601 (GDateTime *datetime) G_GNUC_MALLOC
 

Macro Definition Documentation

◆ G_TIME_SPAN_DAY

#define G_TIME_SPAN_DAY   (G_GINT64_CONSTANT (86400000000))

G_TIME_SPAN_DAY:

Evaluates to a time span of one day.

Since: 2.26

Definition at line 44 of file gdatetime.h.

◆ G_TIME_SPAN_HOUR

#define G_TIME_SPAN_HOUR   (G_GINT64_CONSTANT (3600000000))

G_TIME_SPAN_HOUR:

Evaluates to a time span of one hour.

Since: 2.26

Definition at line 53 of file gdatetime.h.

◆ G_TIME_SPAN_MILLISECOND

#define G_TIME_SPAN_MILLISECOND   (G_GINT64_CONSTANT (1000))

G_TIME_SPAN_MILLISECOND:

Evaluates to a time span of one millisecond.

Since: 2.26

Definition at line 80 of file gdatetime.h.

◆ G_TIME_SPAN_MINUTE

#define G_TIME_SPAN_MINUTE   (G_GINT64_CONSTANT (60000000))

G_TIME_SPAN_MINUTE:

Evaluates to a time span of one minute.

Since: 2.26

Definition at line 62 of file gdatetime.h.

◆ G_TIME_SPAN_SECOND

#define G_TIME_SPAN_SECOND   (G_GINT64_CONSTANT (1000000))

G_TIME_SPAN_SECOND:

Evaluates to a time span of one second.

Since: 2.26

Definition at line 71 of file gdatetime.h.

Typedef Documentation

◆ GDateTime

typedef struct _GDateTime GDateTime

GDateTime:

GDateTime is a structure that combines a Gregorian date and time into a single structure.

GDateTime provides many conversion and methods to manipulate dates and times. Time precision is provided down to microseconds and the time can range (proleptically) from 0001-01-01 00:00:00 to 9999-12-31 23:59:59.999999. GDateTime follows POSIX time in the sense that it is oblivious to leap seconds.

GDateTime is an immutable object; once it has been created it cannot be modified further. All modifiers will create a new GDateTime. Nearly all such functions can fail due to the date or time going out of range, in which case NULL will be returned.

GDateTime is reference counted: the reference count is increased by calling [metho.nosp@m.d@GL.nosp@m.ib.Da.nosp@m.teTi.nosp@m.me.re.nosp@m.f] and decreased by calling [metho.nosp@m.d@GL.nosp@m.ib.Da.nosp@m.teTi.nosp@m.me.un.nosp@m.ref]. When the reference count drops to 0, the resources allocated by the GDateTime structure are released.

Many parts of the API may produce non-obvious results. As an example, adding two months to January 31st will yield March 31st whereas adding one month and then one month again will yield either March 28th or March 29th. Also note that adding 24 hours is not always the same as adding one day (since days containing daylight savings time transitions are either 23 or 25 hours in length).

Since: 2.26

Definition at line 122 of file gdatetime.h.

◆ GTimeSpan

typedef gint64 GTimeSpan

GTimeSpan:

A value representing an interval of time, in microseconds.

Since: 2.26

Definition at line 89 of file gdatetime.h.

Function Documentation

◆ g_date_time_add()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add ( GDateTime * datetime,
GTimeSpan timespan )

◆ g_date_time_add_days()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add_days ( GDateTime * datetime,
gint days )

◆ g_date_time_add_full()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add_full ( GDateTime * datetime,
gint years,
gint months,
gint days,
gint hours,
gint minutes,
gdouble seconds )

◆ g_date_time_add_hours()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add_hours ( GDateTime * datetime,
gint hours )

◆ g_date_time_add_minutes()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add_minutes ( GDateTime * datetime,
gint minutes )

◆ g_date_time_add_months()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add_months ( GDateTime * datetime,
gint months )

◆ g_date_time_add_seconds()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add_seconds ( GDateTime * datetime,
gdouble seconds )

◆ g_date_time_add_weeks()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add_weeks ( GDateTime * datetime,
gint weeks )

◆ g_date_time_add_years()

GLIB_AVAILABLE_IN_ALL G_GNUC_WARN_UNUSED_RESULT GDateTime * g_date_time_add_years ( GDateTime * datetime,
gint years )

◆ g_date_time_compare()

GLIB_AVAILABLE_IN_ALL gint g_date_time_compare ( gconstpointer dt1,
gconstpointer dt2 )

◆ g_date_time_difference()

GLIB_AVAILABLE_IN_ALL GTimeSpan g_date_time_difference ( GDateTime * end,
GDateTime * begin )

◆ g_date_time_equal()

GLIB_AVAILABLE_IN_ALL gboolean g_date_time_equal ( gconstpointer dt1,
gconstpointer dt2 )

◆ g_date_time_format()

GLIB_AVAILABLE_IN_ALL gchar * g_date_time_format ( GDateTime * datetime,
const gchar * format )

◆ g_date_time_format_iso8601()

GLIB_AVAILABLE_IN_2_62 gchar * g_date_time_format_iso8601 ( GDateTime * datetime)

◆ g_date_time_get_day_of_month()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_day_of_month ( GDateTime * datetime)

◆ g_date_time_get_day_of_week()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_day_of_week ( GDateTime * datetime)

◆ g_date_time_get_day_of_year()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_day_of_year ( GDateTime * datetime)

◆ g_date_time_get_hour()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_hour ( GDateTime * datetime)

◆ g_date_time_get_microsecond()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_microsecond ( GDateTime * datetime)

◆ g_date_time_get_minute()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_minute ( GDateTime * datetime)

◆ g_date_time_get_month()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_month ( GDateTime * datetime)

◆ g_date_time_get_second()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_second ( GDateTime * datetime)

◆ g_date_time_get_seconds()

GLIB_AVAILABLE_IN_ALL gdouble g_date_time_get_seconds ( GDateTime * datetime)

◆ g_date_time_get_timezone()

GLIB_AVAILABLE_IN_2_58 GTimeZone * g_date_time_get_timezone ( GDateTime * datetime)

◆ g_date_time_get_timezone_abbreviation()

GLIB_AVAILABLE_IN_ALL const gchar * g_date_time_get_timezone_abbreviation ( GDateTime * datetime)

◆ g_date_time_get_utc_offset()

G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_ALL GTimeSpan g_date_time_get_utc_offset ( GDateTime * datetime)

◆ g_date_time_get_week_numbering_year()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_week_numbering_year ( GDateTime * datetime)

◆ g_date_time_get_week_of_year()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_week_of_year ( GDateTime * datetime)

◆ g_date_time_get_year()

GLIB_AVAILABLE_IN_ALL gint g_date_time_get_year ( GDateTime * datetime)

◆ g_date_time_get_ymd()

GLIB_AVAILABLE_IN_ALL void g_date_time_get_ymd ( GDateTime * datetime,
gint * year,
gint * month,
gint * day )

◆ g_date_time_hash()

GLIB_AVAILABLE_IN_ALL guint g_date_time_hash ( gconstpointer datetime)

◆ g_date_time_is_daylight_savings()

GLIB_AVAILABLE_IN_ALL gboolean g_date_time_is_daylight_savings ( GDateTime * datetime)

◆ g_date_time_new()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_new ( GTimeZone * tz,
gint year,
gint month,
gint day,
gint hour,
gint minute,
gdouble seconds )

◆ g_date_time_new_from_iso8601()

G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_2_56 GDateTime * g_date_time_new_from_iso8601 ( const gchar * text,
GTimeZone * default_tz )

◆ g_date_time_new_from_timeval_local()

G_GNUC_BEGIN_IGNORE_DEPRECATIONS GDateTime * g_date_time_new_from_timeval_local ( const GTimeVal * tv)

◆ g_date_time_new_from_timeval_utc()

GDateTime * g_date_time_new_from_timeval_utc ( const GTimeVal * tv)

◆ g_date_time_new_from_unix_local()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_new_from_unix_local ( gint64 t)

◆ g_date_time_new_from_unix_local_usec()

GLIB_AVAILABLE_IN_2_80 GDateTime * g_date_time_new_from_unix_local_usec ( gint64 usecs)

◆ g_date_time_new_from_unix_utc()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_new_from_unix_utc ( gint64 t)

◆ g_date_time_new_from_unix_utc_usec()

GLIB_AVAILABLE_IN_2_80 GDateTime * g_date_time_new_from_unix_utc_usec ( gint64 usecs)

◆ g_date_time_new_local()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_new_local ( gint year,
gint month,
gint day,
gint hour,
gint minute,
gdouble seconds )

◆ g_date_time_new_now()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_new_now ( GTimeZone * tz)

◆ g_date_time_new_now_local()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_new_now_local ( void )

◆ g_date_time_new_now_utc()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_new_now_utc ( void )

◆ g_date_time_new_utc()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_new_utc ( gint year,
gint month,
gint day,
gint hour,
gint minute,
gdouble seconds )

◆ g_date_time_ref()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_ref ( GDateTime * datetime)

◆ g_date_time_to_local()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_to_local ( GDateTime * datetime)

◆ g_date_time_to_timeval()

G_GNUC_BEGIN_IGNORE_DEPRECATIONS gboolean g_date_time_to_timeval ( GDateTime * datetime,
GTimeVal * tv )

◆ g_date_time_to_timezone()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_to_timezone ( GDateTime * datetime,
GTimeZone * tz )

◆ g_date_time_to_unix()

GLIB_AVAILABLE_IN_ALL gint64 g_date_time_to_unix ( GDateTime * datetime)

◆ g_date_time_to_unix_usec()

GLIB_AVAILABLE_IN_2_80 gint64 g_date_time_to_unix_usec ( GDateTime * datetime)

◆ g_date_time_to_utc()

GLIB_AVAILABLE_IN_ALL GDateTime * g_date_time_to_utc ( GDateTime * datetime)

◆ g_date_time_unref()

GLIB_AVAILABLE_IN_ALL void g_date_time_unref ( GDateTime * datetime)