# GstDateTime

Struct to store date, time and timezone information altogether. GstDateTime is refcounted and immutable.

Date information is handled using the proleptic Gregorian calendar.

Provides basic creation functions and accessor functions to its fields.

## GstDateTime

Opaque, immutable, refcounted struct that stores date, time and timezone information. It currently supports ranges from `0001-01-01` to `9999-12-31` in the Gregorian proleptic calendar.

Use the accessor functions to get the stored values.

## Gst.DateTime

Opaque, immutable, refcounted struct that stores date, time and timezone information. It currently supports ranges from `0001-01-01` to `9999-12-31` in the Gregorian proleptic calendar.

Use the accessor functions to get the stored values.

## Gst.DateTime

Opaque, immutable, refcounted struct that stores date, time and timezone information. It currently supports ranges from `0001-01-01` to `9999-12-31` in the Gregorian proleptic calendar.

Use the accessor functions to get the stored values.

### Constructors

#### gst_date_time_new

    GstDateTime *
    gst_date_time_new (gfloat tzoffset,
                       gint year,
                       gint month,
                       gint day,
                       gint hour,
                       gint minute,
                       gdouble seconds)

Creates a new GstDateTime using the date and times in the gregorian calendar in the supplied timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31, hour from 0 to 23, minutes and seconds from 0 to 59.

Note that tzoffset is a float and was chosen so for being able to handle some fractional timezones, while it still keeps the readability of representing it in hours for most timezones.

If value is -1 then all over value will be ignored. For example if month == -1, then GstDateTime will be created only for year. If day == -1, then GstDateTime will be created for year and month and so on.

Parameters:

`tzoffset` –

Offset from UTC in hours.

`year` –

the gregorian year

`month` –

the gregorian month

`day` –

the day of the gregorian month

`hour` –

the hour of the day

`minute` –

the minute of the hour

`seconds` –

the second of the minute

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime, or NULL on error.

#### Gst.DateTime.prototype.new

    function Gst.DateTime.prototype.new(tzoffset: Number, year: Number, month: Number, day: Number, hour: Number, minute: Number, seconds: Number): {
        // javascript wrapper for 'gst_date_time_new'
    }

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the supplied timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31, hour from 0 to 23, minutes and seconds from 0 to 59.

Note that tzoffset is a float and was chosen so for being able to handle some fractional timezones, while it still keeps the readability of representing it in hours for most timezones.

If value is -1 then all over value will be ignored. For example if month == -1, then Gst.DateTime will be created only for year. If day == -1, then Gst.DateTime will be created for year and month and so on.

Parameters:

`tzoffset` (Number) –

Offset from UTC in hours.

`year` (Number) –

the gregorian year

`month` (Number) –

the gregorian month

`day` (Number) –

the day of the gregorian month

`hour` (Number) –

the hour of the day

`minute` (Number) –

the minute of the hour

`seconds` (Number) –

the second of the minute

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or null on error.

#### Gst.DateTime.new

    def Gst.DateTime.new (tzoffset, year, month, day, hour, minute, seconds):
        #python wrapper for 'gst_date_time_new'

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the supplied timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31, hour from 0 to 23, minutes and seconds from 0 to 59.

Note that tzoffset is a float and was chosen so for being able to handle some fractional timezones, while it still keeps the readability of representing it in hours for most timezones.

If value is -1 then all over value will be ignored. For example if month == -1, then Gst.DateTime will be created only for year. If day == -1, then Gst.DateTime will be created for year and month and so on.

Parameters:

`tzoffset` (float) –

Offset from UTC in hours.

`year` (int) –

the gregorian year

`month` (int) –

the gregorian month

`day` (int) –

the day of the gregorian month

`hour` (int) –

the hour of the day

`minute` (int) –

the minute of the hour

`seconds` (float) –

the second of the minute

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or None on error.

#### gst_date_time_new_from_g_date_time

    GstDateTime *
    gst_date_time_new_from_g_date_time (GDateTime * dt)

Creates a new GstDateTime from a GDateTime object.

Parameters:

`dt` ( [transfer: full][nullable]) –

the GDateTime.

Returns ( [transfer: full][nullable]) –

a newly created GstDateTime, or NULL if dt is NULL.

#### Gst.DateTime.prototype.new_from_g_date_time

    function Gst.DateTime.prototype.new_from_g_date_time(dt: GLib.DateTime): {
        // javascript wrapper for 'gst_date_time_new_from_g_date_time'
    }

Creates a new Gst.DateTime from a GLib.DateTime object.

Parameters:

`dt` (GLib.DateTime) –

the GLib.DateTime.

Returns (Gst.DateTime) –

a newly created Gst.DateTime, or null if dt is null.

#### Gst.DateTime.new_from_g_date_time

    def Gst.DateTime.new_from_g_date_time (dt):
        #python wrapper for 'gst_date_time_new_from_g_date_time'

Creates a new Gst.DateTime from a GLib.DateTime object.

Parameters:

`dt` (GLib.DateTime) –

the GLib.DateTime.

Returns (Gst.DateTime) –

a newly created Gst.DateTime, or None if dt is None.

#### gst_date_time_new_from_iso8601_string

    GstDateTime *
    gst_date_time_new_from_iso8601_string (const gchar * string)

Tries to parse common variants of ISO-8601 datetime strings into a GstDateTime. Possible input formats are (for example): `2012-06-30T22:46:43Z`, `2012`, `2012-06`, `2012-06-30`, `2012-06-30T22:46:43-0430`, `2012-06-30T22:46Z`, `2012-06-30T22:46-0430`, `2012-06-30 22:46`, `2012-06-30 22:46:43`, `2012-06-00`, `2012-00-00`, `2012-00-30`, `22:46:43Z`, `22:46Z`, `22:46:43-0430`, `22:46-0430`, `22:46:30`, `22:46` If no date is provided, it is assumed to be "today" in the timezone provided (if any), otherwise UTC.

Parameters:

`string` –

ISO 8601-formatted datetime string.

Returns ( [transfer: full][nullable]) –

a newly created GstDateTime, or NULL on error

#### Gst.DateTime.prototype.new_from_iso8601_string

    function Gst.DateTime.prototype.new_from_iso8601_string(string: String): {
        // javascript wrapper for 'gst_date_time_new_from_iso8601_string'
    }

Tries to parse common variants of ISO-8601 datetime strings into a Gst.DateTime. Possible input formats are (for example): `2012-06-30T22:46:43Z`, `2012`, `2012-06`, `2012-06-30`, `2012-06-30T22:46:43-0430`, `2012-06-30T22:46Z`, `2012-06-30T22:46-0430`, `2012-06-30 22:46`, `2012-06-30 22:46:43`, `2012-06-00`, `2012-00-00`, `2012-00-30`, `22:46:43Z`, `22:46Z`, `22:46:43-0430`, `22:46-0430`, `22:46:30`, `22:46` If no date is provided, it is assumed to be "today" in the timezone provided (if any), otherwise UTC.

Parameters:

`string` (String) –

ISO 8601-formatted datetime string.

Returns (Gst.DateTime) –

a newly created Gst.DateTime, or null on error

#### Gst.DateTime.new_from_iso8601_string

    def Gst.DateTime.new_from_iso8601_string (string):
        #python wrapper for 'gst_date_time_new_from_iso8601_string'

Tries to parse common variants of ISO-8601 datetime strings into a Gst.DateTime. Possible input formats are (for example): `2012-06-30T22:46:43Z`, `2012`, `2012-06`, `2012-06-30`, `2012-06-30T22:46:43-0430`, `2012-06-30T22:46Z`, `2012-06-30T22:46-0430`, `2012-06-30 22:46`, `2012-06-30 22:46:43`, `2012-06-00`, `2012-00-00`, `2012-00-30`, `22:46:43Z`, `22:46Z`, `22:46:43-0430`, `22:46-0430`, `22:46:30`, `22:46` If no date is provided, it is assumed to be "today" in the timezone provided (if any), otherwise UTC.

Parameters:

`string` (str) –

ISO 8601-formatted datetime string.

Returns (Gst.DateTime) –

a newly created Gst.DateTime, or None on error

#### gst_date_time_new_from_unix_epoch_local_time

    GstDateTime *
    gst_date_time_new_from_unix_epoch_local_time (gint64 secs)

Creates a new GstDateTime using the time since Jan 1, 1970 specified by secs. The GstDateTime is in the local timezone.

Parameters:

`secs` –

seconds from the Unix epoch

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime, or NULL on error.

#### Gst.DateTime.prototype.new_from_unix_epoch_local_time

    function Gst.DateTime.prototype.new_from_unix_epoch_local_time(secs: Number): {
        // javascript wrapper for 'gst_date_time_new_from_unix_epoch_local_time'
    }

Creates a new Gst.DateTime using the time since Jan 1, 1970 specified by secs. The Gst.DateTime is in the local timezone.

Parameters:

`secs` (Number) –

seconds from the Unix epoch

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or null on error.

#### Gst.DateTime.new_from_unix_epoch_local_time

    def Gst.DateTime.new_from_unix_epoch_local_time (secs):
        #python wrapper for 'gst_date_time_new_from_unix_epoch_local_time'

Creates a new Gst.DateTime using the time since Jan 1, 1970 specified by secs. The Gst.DateTime is in the local timezone.

Parameters:

`secs` (int) –

seconds from the Unix epoch

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or None on error.

#### gst_date_time_new_from_unix_epoch_local_time_usecs

    GstDateTime *
    gst_date_time_new_from_unix_epoch_local_time_usecs (gint64 usecs)

Creates a new GstDateTime using the time since Jan 1, 1970 specified by usecs. The GstDateTime is in the local timezone.

Parameters:

`usecs` –

microseconds from the Unix epoch

Returns ( [transfer: full][nullable]) –

a newly created GstDateTime, or NULL on error.

Since : 1.18

#### Gst.DateTime.prototype.new_from_unix_epoch_local_time_usecs

    function Gst.DateTime.prototype.new_from_unix_epoch_local_time_usecs(usecs: Number): {
        // javascript wrapper for 'gst_date_time_new_from_unix_epoch_local_time_usecs'
    }

Creates a new Gst.DateTime using the time since Jan 1, 1970 specified by usecs. The Gst.DateTime is in the local timezone.

Parameters:

`usecs` (Number) –

microseconds from the Unix epoch

Returns (Gst.DateTime) –

a newly created Gst.DateTime, or null on error.

Since : 1.18

#### Gst.DateTime.new_from_unix_epoch_local_time_usecs

    def Gst.DateTime.new_from_unix_epoch_local_time_usecs (usecs):
        #python wrapper for 'gst_date_time_new_from_unix_epoch_local_time_usecs'

Creates a new Gst.DateTime using the time since Jan 1, 1970 specified by usecs. The Gst.DateTime is in the local timezone.

Parameters:

`usecs` (int) –

microseconds from the Unix epoch

Returns (Gst.DateTime) –

a newly created Gst.DateTime, or None on error.

Since : 1.18

#### gst_date_time_new_from_unix_epoch_utc

    GstDateTime *
    gst_date_time_new_from_unix_epoch_utc (gint64 secs)

Creates a new GstDateTime using the time since Jan 1, 1970 specified by secs. The GstDateTime is in the UTC timezone.

Parameters:

`secs` –

seconds from the Unix epoch

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime, or NULL on error.

#### Gst.DateTime.prototype.new_from_unix_epoch_utc

    function Gst.DateTime.prototype.new_from_unix_epoch_utc(secs: Number): {
        // javascript wrapper for 'gst_date_time_new_from_unix_epoch_utc'
    }

Creates a new Gst.DateTime using the time since Jan 1, 1970 specified by secs. The Gst.DateTime is in the UTC timezone.

Parameters:

`secs` (Number) –

seconds from the Unix epoch

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or null on error.

#### Gst.DateTime.new_from_unix_epoch_utc

    def Gst.DateTime.new_from_unix_epoch_utc (secs):
        #python wrapper for 'gst_date_time_new_from_unix_epoch_utc'

Creates a new Gst.DateTime using the time since Jan 1, 1970 specified by secs. The Gst.DateTime is in the UTC timezone.

Parameters:

`secs` (int) –

seconds from the Unix epoch

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or None on error.

#### gst_date_time_new_from_unix_epoch_utc_usecs

    GstDateTime *
    gst_date_time_new_from_unix_epoch_utc_usecs (gint64 usecs)

Creates a new GstDateTime using the time since Jan 1, 1970 specified by usecs. The GstDateTime is in UTC.

Parameters:

`usecs` –

microseconds from the Unix epoch

Returns ( [transfer: full][nullable]) –

a newly created GstDateTime, or NULL on error.

Since : 1.18

#### Gst.DateTime.prototype.new_from_unix_epoch_utc_usecs

    function Gst.DateTime.prototype.new_from_unix_epoch_utc_usecs(usecs: Number): {
        // javascript wrapper for 'gst_date_time_new_from_unix_epoch_utc_usecs'
    }

Creates a new Gst.DateTime using the time since Jan 1, 1970 specified by usecs. The Gst.DateTime is in UTC.

Parameters:

`usecs` (Number) –

microseconds from the Unix epoch

Returns (Gst.DateTime) –

a newly created Gst.DateTime, or null on error.

Since : 1.18

#### Gst.DateTime.new_from_unix_epoch_utc_usecs

    def Gst.DateTime.new_from_unix_epoch_utc_usecs (usecs):
        #python wrapper for 'gst_date_time_new_from_unix_epoch_utc_usecs'

Creates a new Gst.DateTime using the time since Jan 1, 1970 specified by usecs. The Gst.DateTime is in UTC.

Parameters:

`usecs` (int) –

microseconds from the Unix epoch

Returns (Gst.DateTime) –

a newly created Gst.DateTime, or None on error.

Since : 1.18

#### gst_date_time_new_local_time

    GstDateTime *
    gst_date_time_new_local_time (gint year,
                                  gint month,
                                  gint day,
                                  gint hour,
                                  gint minute,
                                  gdouble seconds)

Creates a new GstDateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31, hour from 0 to 23, minutes and seconds from 0 to 59.

If month is -1, then the GstDateTime created will only contain year, and all other fields will be considered not set.

If day is -1, then the GstDateTime created will only contain year and month and all other fields will be considered not set.

If hour is -1, then the GstDateTime created will only contain year and month and day, and the time fields will be considered not set. In this case minute and seconds should also be -1.

Parameters:

`year` –

the gregorian year

`month` –

the gregorian month, or -1

`day` –

the day of the gregorian month, or -1

`hour` –

the hour of the day, or -1

`minute` –

the minute of the hour, or -1

`seconds` –

the second of the minute, or -1

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime, or NULL on error.

#### Gst.DateTime.prototype.new_local_time

    function Gst.DateTime.prototype.new_local_time(year: Number, month: Number, day: Number, hour: Number, minute: Number, seconds: Number): {
        // javascript wrapper for 'gst_date_time_new_local_time'
    }

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31, hour from 0 to 23, minutes and seconds from 0 to 59.

If month is -1, then the Gst.DateTime created will only contain year, and all other fields will be considered not set.

If day is -1, then the Gst.DateTime created will only contain year and month and all other fields will be considered not set.

If hour is -1, then the Gst.DateTime created will only contain year and month and day, and the time fields will be considered not set. In this case minute and seconds should also be -1.

Parameters:

`year` (Number) –

the gregorian year

`month` (Number) –

the gregorian month, or -1

`day` (Number) –

the day of the gregorian month, or -1

`hour` (Number) –

the hour of the day, or -1

`minute` (Number) –

the minute of the hour, or -1

`seconds` (Number) –

the second of the minute, or -1

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or null on error.

#### Gst.DateTime.new_local_time

    def Gst.DateTime.new_local_time (year, month, day, hour, minute, seconds):
        #python wrapper for 'gst_date_time_new_local_time'

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31, hour from 0 to 23, minutes and seconds from 0 to 59.

If month is -1, then the Gst.DateTime created will only contain year, and all other fields will be considered not set.

If day is -1, then the Gst.DateTime created will only contain year and month and all other fields will be considered not set.

If hour is -1, then the Gst.DateTime created will only contain year and month and day, and the time fields will be considered not set. In this case minute and seconds should also be -1.

Parameters:

`year` (int) –

the gregorian year

`month` (int) –

the gregorian month, or -1

`day` (int) –

the day of the gregorian month, or -1

`hour` (int) –

the hour of the day, or -1

`minute` (int) –

the minute of the hour, or -1

`seconds` (float) –

the second of the minute, or -1

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or None on error.

#### gst_date_time_new_now_local_time

    GstDateTime *
    gst_date_time_new_now_local_time ()

Creates a new GstDateTime representing the current date and time.

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime which should be freed with gst_date_time_unref, or NULL on error.

#### Gst.DateTime.prototype.new_now_local_time

    function Gst.DateTime.prototype.new_now_local_time(): {
        // javascript wrapper for 'gst_date_time_new_now_local_time'
    }

Creates a new Gst.DateTime representing the current date and time.

Returns (Gst.DateTime) –

the newly created Gst.DateTime which should be freed with Gst.DateTime.prototype.unref, or null on error.

#### Gst.DateTime.new_now_local_time

    def Gst.DateTime.new_now_local_time ():
        #python wrapper for 'gst_date_time_new_now_local_time'

Creates a new Gst.DateTime representing the current date and time.

Returns (Gst.DateTime) –

the newly created Gst.DateTime which should be freed with Gst.DateTime.unref, or None on error.

#### gst_date_time_new_now_utc

    GstDateTime *
    gst_date_time_new_now_utc ()

Creates a new GstDateTime that represents the current instant at Universal coordinated time.

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime which should be freed with gst_date_time_unref, or NULL on error.

#### Gst.DateTime.prototype.new_now_utc

    function Gst.DateTime.prototype.new_now_utc(): {
        // javascript wrapper for 'gst_date_time_new_now_utc'
    }

Creates a new Gst.DateTime that represents the current instant at Universal coordinated time.

Returns (Gst.DateTime) –

the newly created Gst.DateTime which should be freed with Gst.DateTime.prototype.unref, or null on error.

#### Gst.DateTime.new_now_utc

    def Gst.DateTime.new_now_utc ():
        #python wrapper for 'gst_date_time_new_now_utc'

Creates a new Gst.DateTime that represents the current instant at Universal coordinated time.

Returns (Gst.DateTime) –

the newly created Gst.DateTime which should be freed with Gst.DateTime.unref, or None on error.

#### gst_date_time_new_y

    GstDateTime *
    gst_date_time_new_y (gint year)

Creates a new GstDateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999.

Parameters:

`year` –

the gregorian year

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime, or NULL on error.

#### Gst.DateTime.prototype.new_y

    function Gst.DateTime.prototype.new_y(year: Number): {
        // javascript wrapper for 'gst_date_time_new_y'
    }

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999.

Parameters:

`year` (Number) –

the gregorian year

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or null on error.

#### Gst.DateTime.new_y

    def Gst.DateTime.new_y (year):
        #python wrapper for 'gst_date_time_new_y'

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999.

Parameters:

`year` (int) –

the gregorian year

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or None on error.

#### gst_date_time_new_ym

    GstDateTime *
    gst_date_time_new_ym (gint year,
                          gint month)

Creates a new GstDateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12.

If value is -1 then all over value will be ignored. For example if month == -1, then GstDateTime will created only for year.

Parameters:

`year` –

the gregorian year

`month` –

the gregorian month

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime, or NULL on error.

#### Gst.DateTime.prototype.new_ym

    function Gst.DateTime.prototype.new_ym(year: Number, month: Number): {
        // javascript wrapper for 'gst_date_time_new_ym'
    }

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12.

If value is -1 then all over value will be ignored. For example if month == -1, then Gst.DateTime will created only for year.

Parameters:

`year` (Number) –

the gregorian year

`month` (Number) –

the gregorian month

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or null on error.

#### Gst.DateTime.new_ym

    def Gst.DateTime.new_ym (year, month):
        #python wrapper for 'gst_date_time_new_ym'

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12.

If value is -1 then all over value will be ignored. For example if month == -1, then Gst.DateTime will created only for year.

Parameters:

`year` (int) –

the gregorian year

`month` (int) –

the gregorian month

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or None on error.

#### gst_date_time_new_ymd

    GstDateTime *
    gst_date_time_new_ymd (gint year,
                           gint month,
                           gint day)

Creates a new GstDateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31.

If value is -1 then all over value will be ignored. For example if month == -1, then GstDateTime will created only for year. If day == -1, then GstDateTime will created for year and month and so on.

Parameters:

`year` –

the gregorian year

`month` –

the gregorian month

`day` –

the day of the gregorian month

Returns ( [transfer: full][nullable]) –

the newly created GstDateTime, or NULL on error.

#### Gst.DateTime.prototype.new_ymd

    function Gst.DateTime.prototype.new_ymd(year: Number, month: Number, day: Number): {
        // javascript wrapper for 'gst_date_time_new_ymd'
    }

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31.

If value is -1 then all over value will be ignored. For example if month == -1, then Gst.DateTime will created only for year. If day == -1, then Gst.DateTime will created for year and month and so on.

Parameters:

`year` (Number) –

the gregorian year

`month` (Number) –

the gregorian month

`day` (Number) –

the day of the gregorian month

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or null on error.

#### Gst.DateTime.new_ymd

    def Gst.DateTime.new_ymd (year, month, day):
        #python wrapper for 'gst_date_time_new_ymd'

Creates a new Gst.DateTime using the date and times in the gregorian calendar in the local timezone.

year should be from 1 to 9999, month should be from 1 to 12, day from 1 to 31.

If value is -1 then all over value will be ignored. For example if month == -1, then Gst.DateTime will created only for year. If day == -1, then Gst.DateTime will created for year and month and so on.

Parameters:

`year` (int) –

the gregorian year

`month` (int) –

the gregorian month

`day` (int) –

the day of the gregorian month

Returns (Gst.DateTime) –

the newly created Gst.DateTime, or None on error.

### Methods

#### gst_date_time_get_day

    gint
    gst_date_time_get_day (const GstDateTime * datetime)

Returns the day of the month of this GstDateTime.

Parameters:

`datetime` –

a GstDateTime

Returns –

The day of this GstDateTime, or -1 if none is set.

#### Gst.DateTime.prototype.get_day

    function Gst.DateTime.prototype.get_day(): {
        // javascript wrapper for 'gst_date_time_get_day'
    }

Returns the day of the month of this Gst.DateTime.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

The day of this Gst.DateTime, or -1 if none is set.

#### Gst.DateTime.get_day

    def Gst.DateTime.get_day (self):
        #python wrapper for 'gst_date_time_get_day'

Returns the day of the month of this Gst.DateTime.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (int) –

The day of this Gst.DateTime, or -1 if none is set.

#### gst_date_time_get_hour

    gint
    gst_date_time_get_hour (const GstDateTime * datetime)

Retrieves the hour of the day represented by datetime in the gregorian calendar. The return is in the range of 0 to 23.

Parameters:

`datetime` –

a GstDateTime

Returns –

the hour of the day, or -1 if none is set.

#### Gst.DateTime.prototype.get_hour

    function Gst.DateTime.prototype.get_hour(): {
        // javascript wrapper for 'gst_date_time_get_hour'
    }

Retrieves the hour of the day represented by datetime in the gregorian calendar. The return is in the range of 0 to 23.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

the hour of the day, or -1 if none is set.

#### Gst.DateTime.get_hour

    def Gst.DateTime.get_hour (self):
        #python wrapper for 'gst_date_time_get_hour'

Retrieves the hour of the day represented by datetime in the gregorian calendar. The return is in the range of 0 to 23.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (int) –

the hour of the day, or -1 if none is set.

#### gst_date_time_get_microsecond

    gint
    gst_date_time_get_microsecond (const GstDateTime * datetime)

Retrieves the fractional part of the seconds in microseconds represented by datetime in the gregorian calendar.

Parameters:

`datetime` –

a GstDateTime

Returns –

the microsecond of the second, or -1 if none is set.

#### Gst.DateTime.prototype.get_microsecond

    function Gst.DateTime.prototype.get_microsecond(): {
        // javascript wrapper for 'gst_date_time_get_microsecond'
    }

Retrieves the fractional part of the seconds in microseconds represented by datetime in the gregorian calendar.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

the microsecond of the second, or -1 if none is set.

#### Gst.DateTime.get_microsecond

    def Gst.DateTime.get_microsecond (self):
        #python wrapper for 'gst_date_time_get_microsecond'

Retrieves the fractional part of the seconds in microseconds represented by datetime in the gregorian calendar.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (int) –

the microsecond of the second, or -1 if none is set.

#### gst_date_time_get_minute

    gint
    gst_date_time_get_minute (const GstDateTime * datetime)

Retrieves the minute of the hour represented by datetime in the gregorian calendar.

Parameters:

`datetime` –

a GstDateTime

Returns –

the minute of the hour, or -1 if none is set.

#### Gst.DateTime.prototype.get_minute

    function Gst.DateTime.prototype.get_minute(): {
        // javascript wrapper for 'gst_date_time_get_minute'
    }

Retrieves the minute of the hour represented by datetime in the gregorian calendar.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

the minute of the hour, or -1 if none is set.

#### Gst.DateTime.get_minute

    def Gst.DateTime.get_minute (self):
        #python wrapper for 'gst_date_time_get_minute'

Retrieves the minute of the hour represented by datetime in the gregorian calendar.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (int) –

the minute of the hour, or -1 if none is set.

#### gst_date_time_get_month

    gint
    gst_date_time_get_month (const GstDateTime * datetime)

Returns the month of this GstDateTime. January is 1, February is 2, etc..

Parameters:

`datetime` –

a GstDateTime

Returns –

The month of this GstDateTime, or -1 if none is set.

#### Gst.DateTime.prototype.get_month

    function Gst.DateTime.prototype.get_month(): {
        // javascript wrapper for 'gst_date_time_get_month'
    }

Returns the month of this Gst.DateTime. January is 1, February is 2, etc..

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

The month of this Gst.DateTime, or -1 if none is set.

#### Gst.DateTime.get_month

    def Gst.DateTime.get_month (self):
        #python wrapper for 'gst_date_time_get_month'

Returns the month of this Gst.DateTime. January is 1, February is 2, etc..

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (int) –

The month of this Gst.DateTime, or -1 if none is set.

#### gst_date_time_get_second

    gint
    gst_date_time_get_second (const GstDateTime * datetime)

Retrieves the second of the minute represented by datetime in the gregorian calendar.

Parameters:

`datetime` –

a GstDateTime

Returns –

the second represented by datetime, or -1 if none is set.

#### Gst.DateTime.prototype.get_second

    function Gst.DateTime.prototype.get_second(): {
        // javascript wrapper for 'gst_date_time_get_second'
    }

Retrieves the second of the minute represented by datetime in the gregorian calendar.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

the second represented by datetime, or -1 if none is set.

#### Gst.DateTime.get_second

    def Gst.DateTime.get_second (self):
        #python wrapper for 'gst_date_time_get_second'

Retrieves the second of the minute represented by datetime in the gregorian calendar.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (int) –

the second represented by datetime, or -1 if none is set.

#### gst_date_time_get_time_zone_offset

    gfloat
    gst_date_time_get_time_zone_offset (const GstDateTime * datetime)

Retrieves the offset from UTC in hours that the timezone specified by datetime represents. Timezones ahead (to the east) of UTC have positive values, timezones before (to the west) of UTC have negative values. If datetime represents UTC time, then the offset is zero.

Parameters:

`datetime` –

a GstDateTime

Returns –

the offset from UTC in hours, or G_MAXFLOAT if none is set.

#### Gst.DateTime.prototype.get_time_zone_offset

    function Gst.DateTime.prototype.get_time_zone_offset(): {
        // javascript wrapper for 'gst_date_time_get_time_zone_offset'
    }

Retrieves the offset from UTC in hours that the timezone specified by datetime represents. Timezones ahead (to the east) of UTC have positive values, timezones before (to the west) of UTC have negative values. If datetime represents UTC time, then the offset is zero.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

the offset from UTC in hours, or G_MAXFLOAT (not introspectable) if none is set.

#### Gst.DateTime.get_time_zone_offset

    def Gst.DateTime.get_time_zone_offset (self):
        #python wrapper for 'gst_date_time_get_time_zone_offset'

Retrieves the offset from UTC in hours that the timezone specified by datetime represents. Timezones ahead (to the east) of UTC have positive values, timezones before (to the west) of UTC have negative values. If datetime represents UTC time, then the offset is zero.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (float) –

the offset from UTC in hours, or G_MAXFLOAT (not introspectable) if none is set.

#### gst_date_time_get_year

    gint
    gst_date_time_get_year (const GstDateTime * datetime)

Returns the year of this GstDateTime. Call gst_date_time_has_year before, to avoid warnings.

Parameters:

`datetime` –

a GstDateTime

Returns –

The year of this GstDateTime

#### Gst.DateTime.prototype.get_year

    function Gst.DateTime.prototype.get_year(): {
        // javascript wrapper for 'gst_date_time_get_year'
    }

Returns the year of this Gst.DateTime. Call Gst.DateTime.prototype.has_year before, to avoid warnings.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

The year of this Gst.DateTime

#### Gst.DateTime.get_year

    def Gst.DateTime.get_year (self):
        #python wrapper for 'gst_date_time_get_year'

Returns the year of this Gst.DateTime. Call Gst.DateTime.has_year before, to avoid warnings.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (int) –

The year of this Gst.DateTime

#### gst_date_time_has_day

    gboolean
    gst_date_time_has_day (const GstDateTime * datetime)

Parameters:

`datetime` –

a GstDateTime

Returns –

TRUE if datetime's day field is set, otherwise FALSE

#### Gst.DateTime.prototype.has_day

    function Gst.DateTime.prototype.has_day(): {
        // javascript wrapper for 'gst_date_time_has_day'
    }

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

true if datetime's day field is set, otherwise false

#### Gst.DateTime.has_day

    def Gst.DateTime.has_day (self):
        #python wrapper for 'gst_date_time_has_day'

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (bool) –

True if datetime's day field is set, otherwise False

#### gst_date_time_has_month

    gboolean
    gst_date_time_has_month (const GstDateTime * datetime)

Parameters:

`datetime` –

a GstDateTime

Returns –

TRUE if datetime's month field is set, otherwise FALSE

#### Gst.DateTime.prototype.has_month

    function Gst.DateTime.prototype.has_month(): {
        // javascript wrapper for 'gst_date_time_has_month'
    }

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

true if datetime's month field is set, otherwise false

#### Gst.DateTime.has_month

    def Gst.DateTime.has_month (self):
        #python wrapper for 'gst_date_time_has_month'

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (bool) –

True if datetime's month field is set, otherwise False

#### gst_date_time_has_second

    gboolean
    gst_date_time_has_second (const GstDateTime * datetime)

Parameters:

`datetime` –

a GstDateTime

Returns –

TRUE if datetime's second field is set, otherwise FALSE

#### Gst.DateTime.prototype.has_second

    function Gst.DateTime.prototype.has_second(): {
        // javascript wrapper for 'gst_date_time_has_second'
    }

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

true if datetime's second field is set, otherwise false

#### Gst.DateTime.has_second

    def Gst.DateTime.has_second (self):
        #python wrapper for 'gst_date_time_has_second'

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (bool) –

True if datetime's second field is set, otherwise False

#### gst_date_time_has_time

    gboolean
    gst_date_time_has_time (const GstDateTime * datetime)

Parameters:

`datetime` –

a GstDateTime

Returns –

TRUE if datetime's hour and minute fields are set, otherwise FALSE

#### Gst.DateTime.prototype.has_time

    function Gst.DateTime.prototype.has_time(): {
        // javascript wrapper for 'gst_date_time_has_time'
    }

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

true if datetime's hour and minute fields are set, otherwise false

#### Gst.DateTime.has_time

    def Gst.DateTime.has_time (self):
        #python wrapper for 'gst_date_time_has_time'

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (bool) –

True if datetime's hour and minute fields are set, otherwise False

#### gst_date_time_has_year

    gboolean
    gst_date_time_has_year (const GstDateTime * datetime)

Parameters:

`datetime` –

a GstDateTime

Returns –

TRUE if datetime's year field is set (which should always be the case), otherwise FALSE

#### Gst.DateTime.prototype.has_year

    function Gst.DateTime.prototype.has_year(): {
        // javascript wrapper for 'gst_date_time_has_year'
    }

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Number) –

true if datetime's year field is set (which should always be the case), otherwise false

#### Gst.DateTime.has_year

    def Gst.DateTime.has_year (self):
        #python wrapper for 'gst_date_time_has_year'

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (bool) –

True if datetime's year field is set (which should always be the case), otherwise False

#### gst_date_time_ref

    GstDateTime *
    gst_date_time_ref (GstDateTime * datetime)

Atomically increments the reference count of datetime by one.

Parameters:

`datetime` –

a GstDateTime

Returns ( [transfer: full]) –

the reference datetime

#### Gst.DateTime.prototype.ref

    function Gst.DateTime.prototype.ref(): {
        // javascript wrapper for 'gst_date_time_ref'
    }

Atomically increments the reference count of datetime by one.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Gst.DateTime) –

the reference datetime

#### Gst.DateTime.ref

    def Gst.DateTime.ref (self):
        #python wrapper for 'gst_date_time_ref'

Atomically increments the reference count of datetime by one.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

Returns (Gst.DateTime) –

the reference datetime

#### gst_date_time_to_g_date_time

    GDateTime *
    gst_date_time_to_g_date_time (GstDateTime * datetime)

Creates a new GDateTime from a fully defined GstDateTime object.

Parameters:

`datetime` –

GstDateTime.

Returns ( [transfer: full][nullable]) –

a newly created GDateTime, or NULL on error or if datetime does not have a year, month, day, hour, minute and second.

#### Gst.DateTime.prototype.to_g_date_time

    function Gst.DateTime.prototype.to_g_date_time(): {
        // javascript wrapper for 'gst_date_time_to_g_date_time'
    }

Creates a new GLib.DateTime from a fully defined Gst.DateTime object.

Parameters:

`datetime` (Gst.DateTime) –

GstDateTime.

Returns (GLib.DateTime) –

a newly created GLib.DateTime, or null on error or if datetime does not have a year, month, day, hour, minute and second.

#### Gst.DateTime.to_g_date_time

    def Gst.DateTime.to_g_date_time (self):
        #python wrapper for 'gst_date_time_to_g_date_time'

Creates a new GLib.DateTime from a fully defined Gst.DateTime object.

Parameters:

`datetime` (Gst.DateTime) –

GstDateTime.

Returns (GLib.DateTime) –

a newly created GLib.DateTime, or None on error or if datetime does not have a year, month, day, hour, minute and second.

#### gst_date_time_to_iso8601_string

    gchar *
    gst_date_time_to_iso8601_string (GstDateTime * datetime)

Create a minimal string compatible with ISO-8601. Possible output formats are (for example): `2012`, `2012-06`, `2012-06-23`, `2012-06-23T23:30Z`, `2012-06-23T23:30+0100`, `2012-06-23T23:30:59Z`, `2012-06-23T23:30:59+0100`

Parameters:

`datetime` –

a GstDateTime.

Returns ( [nullable]) –

a newly allocated string formatted according to ISO 8601 and only including the datetime fields that are valid, or NULL in case there was an error.

#### Gst.DateTime.prototype.to_iso8601_string

    function Gst.DateTime.prototype.to_iso8601_string(): {
        // javascript wrapper for 'gst_date_time_to_iso8601_string'
    }

Create a minimal string compatible with ISO-8601. Possible output formats are (for example): `2012`, `2012-06`, `2012-06-23`, `2012-06-23T23:30Z`, `2012-06-23T23:30+0100`, `2012-06-23T23:30:59Z`, `2012-06-23T23:30:59+0100`

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime.

Returns (String) –

a newly allocated string formatted according to ISO 8601 and only including the datetime fields that are valid, or null in case there was an error.

#### Gst.DateTime.to_iso8601_string

    def Gst.DateTime.to_iso8601_string (self):
        #python wrapper for 'gst_date_time_to_iso8601_string'

Create a minimal string compatible with ISO-8601. Possible output formats are (for example): `2012`, `2012-06`, `2012-06-23`, `2012-06-23T23:30Z`, `2012-06-23T23:30+0100`, `2012-06-23T23:30:59Z`, `2012-06-23T23:30:59+0100`

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime.

Returns (str) –

a newly allocated string formatted according to ISO 8601 and only including the datetime fields that are valid, or None in case there was an error.

#### gst_date_time_unref

    gst_date_time_unref (GstDateTime * datetime)

Atomically decrements the reference count of datetime by one. When the reference count reaches zero, the structure is freed.

Parameters:

`datetime` ( [transfer: full]) –

a GstDateTime

#### Gst.DateTime.prototype.unref

    function Gst.DateTime.prototype.unref(): {
        // javascript wrapper for 'gst_date_time_unref'
    }

Atomically decrements the reference count of datetime by one. When the reference count reaches zero, the structure is freed.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

#### Gst.DateTime.unref

    def Gst.DateTime.unref (self):
        #python wrapper for 'gst_date_time_unref'

Atomically decrements the reference count of datetime by one. When the reference count reaches zero, the structure is freed.

Parameters:

`datetime` (Gst.DateTime) –

a Gst.DateTime

## Constants

### GST_TYPE_DATE_TIME

    #define GST_TYPE_DATE_TIME (_gst_date_time_type)

a boxed GValue type for GstDateTime that represents a date and time.

The results of the search are