Struct

GLibDateTime

Description [src]

struct GDateTime {
  /* No available fields */
}

An opaque structure that represents a date and time, including a time zone.

Available since:2.26

Constructors

g_date_time_new

Creates a new GDateTime corresponding to the given date and time in the time zone tz.

Available since: 2.26

g_date_time_new_from_iso8601

Creates a GDateTime corresponding to the given ISO 8601 formatted string text. ISO 8601 strings of the form

Available since: 2.56

g_date_time_new_from_timeval_local

Creates a GDateTime corresponding to the given GTimeVal tv in the local time zone.

Available since: 2.26

Deprecated since: 2.62

g_date_time_new_from_timeval_utc

Creates a GDateTime corresponding to the given GTimeVal tv in UTC.

Available since: 2.26

Deprecated since: 2.62

g_date_time_new_from_unix_local

Creates a GDateTime corresponding to the given Unix time t in the local time zone.

Available since: 2.26

g_date_time_new_from_unix_utc

Creates a GDateTime corresponding to the given Unix time t in UTC.

Available since: 2.26

g_date_time_new_local

Creates a new GDateTime corresponding to the given date and time in the local time zone.

Available since: 2.26

g_date_time_new_now

Creates a GDateTime corresponding to this exact instant in the given time zone tz. The time is as accurate as the system allows, to a maximum accuracy of 1 microsecond.

Available since: 2.26

g_date_time_new_now_local

Creates a GDateTime corresponding to this exact instant in the local time zone.

Available since: 2.26

g_date_time_new_now_utc

Creates a GDateTime corresponding to this exact instant in UTC.

Available since: 2.26

g_date_time_new_utc

Creates a new GDateTime corresponding to the given date and time in UTC.

Available since: 2.26

Instance methods

g_date_time_add

Creates a copy of datetime and adds the specified timespan to the copy.

Available since: 2.26

g_date_time_add_days

Creates a copy of datetime and adds the specified number of days to the copy. Add negative values to subtract days.

Available since: 2.26

g_date_time_add_full

Creates a new GDateTime adding the specified values to the current date and time in datetime. Add negative values to subtract.

Available since: 2.26

g_date_time_add_hours

Creates a copy of datetime and adds the specified number of hours. Add negative values to subtract hours.

Available since: 2.26

g_date_time_add_minutes

Creates a copy of datetime adding the specified number of minutes. Add negative values to subtract minutes.

Available since: 2.26

g_date_time_add_months

Creates a copy of datetime and adds the specified number of months to the copy. Add negative values to subtract months.

Available since: 2.26

g_date_time_add_seconds

Creates a copy of datetime and adds the specified number of seconds. Add negative values to subtract seconds.

Available since: 2.26

g_date_time_add_weeks

Creates a copy of datetime and adds the specified number of weeks to the copy. Add negative values to subtract weeks.

Available since: 2.26

g_date_time_add_years

Creates a copy of datetime and adds the specified number of years to the copy. Add negative values to subtract years.

Available since: 2.26

g_date_time_compare

A comparison function for GDateTimes that is suitable as a GCompareFunc. Both GDateTimes must be non-NULL.

Available since: 2.26

g_date_time_difference

Calculates the difference in time between end and begin. The GTimeSpan that is returned is effectively end - begin (ie: positive if the first parameter is larger).

Available since: 2.26

g_date_time_equal

Checks to see if dt1 and dt2 are equal.

Available since: 2.26

g_date_time_format

Creates a newly allocated string representing the requested format.

Available since: 2.26

g_date_time_format_iso8601

Format datetime in ISO 8601 format, including the date, time and time zone, and return that as a UTF-8 encoded string.

Available since: 2.62

g_date_time_get_day_of_month

Retrieves the day of the month represented by datetime in the gregorian calendar.

Available since: 2.26

g_date_time_get_day_of_week

Retrieves the ISO 8601 day of the week on which datetime falls (1 is Monday, 2 is Tuesday… 7 is Sunday).

Available since: 2.26

g_date_time_get_day_of_year

Retrieves the day of the year represented by datetime in the Gregorian calendar.

Available since: 2.26

g_date_time_get_hour

Retrieves the hour of the day represented by datetime.

Available since: 2.26

g_date_time_get_microsecond

Retrieves the microsecond of the date represented by datetime.

Available since: 2.26

g_date_time_get_minute

Retrieves the minute of the hour represented by datetime.

Available since: 2.26

g_date_time_get_month

Retrieves the month of the year represented by datetime in the Gregorian calendar.

Available since: 2.26

g_date_time_get_second

Retrieves the second of the minute represented by datetime.

Available since: 2.26

g_date_time_get_seconds

Retrieves the number of seconds since the start of the last minute, including the fractional part.

Available since: 2.26

g_date_time_get_timezone

Get the time zone for this datetime.

Available since: 2.58

g_date_time_get_timezone_abbreviation

Determines the time zone abbreviation to be used at the time and in the time zone of datetime.

Available since: 2.26

g_date_time_get_utc_offset

Determines the offset to UTC in effect at the time and in the time zone of datetime.

Available since: 2.26

g_date_time_get_week_numbering_year

Returns the ISO 8601 week-numbering year in which the week containing datetime falls.

Available since: 2.26

g_date_time_get_week_of_year

Returns the ISO 8601 week number for the week containing datetime. The ISO 8601 week number is the same for every day of the week (from Moday through Sunday). That can produce some unusual results (described below).

Available since: 2.26

g_date_time_get_year

Retrieves the year represented by datetime in the Gregorian calendar.

Available since: 2.26

g_date_time_get_ymd

Retrieves the Gregorian day, month, and year of a given GDateTime.

Available since: 2.26

g_date_time_hash

Hashes datetime into a #guint, suitable for use within GHashTable.

Available since: 2.26

g_date_time_is_daylight_savings

Determines if daylight savings time is in effect at the time and in the time zone of datetime.

Available since: 2.26

g_date_time_ref

Atomically increments the reference count of datetime by one.

Available since: 2.26

g_date_time_to_local

Creates a new GDateTime corresponding to the same instant in time as datetime, but in the local time zone.

Available since: 2.26

g_date_time_to_timeval

Stores the instant in time that datetime represents into tv.

Available since: 2.26

Deprecated since: 2.62

g_date_time_to_timezone

Create a new GDateTime corresponding to the same instant in time as datetime, but in the time zone tz.

Available since: 2.26

g_date_time_to_unix

Gives the Unix time corresponding to datetime, rounding down to the nearest second.

Available since: 2.26

g_date_time_to_utc

Creates a new GDateTime corresponding to the same instant in time as datetime, but in UTC.

Available since: 2.26

g_date_time_unref

Atomically decrements the reference count of datetime by one.

Available since: 2.26