:right-sidebar: True DateTime =================================================================== .. currentmodule:: gi.repository.GObject .. class:: DateTime(**kwargs) :no-contents-entry: :Constructors: :: new(tz:GLib.TimeZone, year:int, month:int, day:int, hour:int, minute:int, seconds:float) -> GLib.DateTime or None new_from_iso8601(text:str, default_tz:GLib.TimeZone=None) -> GLib.DateTime or None new_from_timeval_local(tv:GLib.TimeVal) -> GLib.DateTime or None new_from_timeval_utc(tv:GLib.TimeVal) -> GLib.DateTime or None new_from_unix_local(t:int) -> GLib.DateTime or None new_from_unix_local_usec(usecs:int) -> GLib.DateTime or None new_from_unix_utc(t:int) -> GLib.DateTime or None new_from_unix_utc_usec(usecs:int) -> GLib.DateTime or None new_local(year:int, month:int, day:int, hour:int, minute:int, seconds:float) -> GLib.DateTime or None new_now(tz:GLib.TimeZone) -> GLib.DateTime or None new_now_local() -> GLib.DateTime or None new_now_utc() -> GLib.DateTime or None new_utc(year:int, month:int, day:int, hour:int, minute:int, seconds:float) -> GLib.DateTime or None Constructors ------------ .. rst-class:: interim-class .. class:: DateTime :no-index: .. classmethod:: new(tz: ~gi.repository.GLib.TimeZone, year: int, month: int, day: int, hour: int, minute: int, seconds: float) -> ~gi.repository.GLib.DateTime | None :param tz: :param year: :param month: :param day: :param hour: :param minute: :param seconds: .. classmethod:: new_from_iso8601(text: str, default_tz: ~gi.repository.GLib.TimeZone | None = None) -> ~gi.repository.GLib.DateTime | None :param text: :param default_tz: .. classmethod:: new_from_timeval_local(tv: ~gi.repository.GLib.TimeVal) -> ~gi.repository.GLib.DateTime | None :param tv: .. classmethod:: new_from_timeval_utc(tv: ~gi.repository.GLib.TimeVal) -> ~gi.repository.GLib.DateTime | None :param tv: .. classmethod:: new_from_unix_local(t: int) -> ~gi.repository.GLib.DateTime | None :param t: .. classmethod:: new_from_unix_local_usec(usecs: int) -> ~gi.repository.GLib.DateTime | None :param usecs: .. classmethod:: new_from_unix_utc(t: int) -> ~gi.repository.GLib.DateTime | None :param t: .. classmethod:: new_from_unix_utc_usec(usecs: int) -> ~gi.repository.GLib.DateTime | None :param usecs: .. classmethod:: new_local(year: int, month: int, day: int, hour: int, minute: int, seconds: float) -> ~gi.repository.GLib.DateTime | None :param year: :param month: :param day: :param hour: :param minute: :param seconds: .. classmethod:: new_now(tz: ~gi.repository.GLib.TimeZone) -> ~gi.repository.GLib.DateTime | None :param tz: .. classmethod:: new_now_local() -> ~gi.repository.GLib.DateTime | None .. classmethod:: new_now_utc() -> ~gi.repository.GLib.DateTime | None .. classmethod:: new_utc(year: int, month: int, day: int, hour: int, minute: int, seconds: float) -> ~gi.repository.GLib.DateTime | None :param year: :param month: :param day: :param hour: :param minute: :param seconds: Methods ------- .. rst-class:: interim-class .. class:: DateTime :no-index: .. method:: add(timespan: int) -> ~gi.repository.GLib.DateTime | None :param timespan: .. method:: add_days(days: int) -> ~gi.repository.GLib.DateTime | None :param days: .. method:: add_full(years: int, months: int, days: int, hours: int, minutes: int, seconds: float) -> ~gi.repository.GLib.DateTime | None :param years: :param months: :param days: :param hours: :param minutes: :param seconds: .. method:: add_hours(hours: int) -> ~gi.repository.GLib.DateTime | None :param hours: .. method:: add_minutes(minutes: int) -> ~gi.repository.GLib.DateTime | None :param minutes: .. method:: add_months(months: int) -> ~gi.repository.GLib.DateTime | None :param months: .. method:: add_seconds(seconds: float) -> ~gi.repository.GLib.DateTime | None :param seconds: .. method:: add_weeks(weeks: int) -> ~gi.repository.GLib.DateTime | None :param weeks: .. method:: add_years(years: int) -> ~gi.repository.GLib.DateTime | None :param years: .. method:: compare(dt2: ~gi.repository.GLib.DateTime) -> int :param dt2: .. method:: difference(begin: ~gi.repository.GLib.DateTime) -> int :param begin: .. method:: equal(dt2: ~gi.repository.GLib.DateTime) -> bool :param dt2: .. method:: format(format: str) -> str | None :param format: .. method:: format_iso8601() -> str | None .. method:: get_day_of_month() -> int .. method:: get_day_of_week() -> int .. method:: get_day_of_year() -> int .. method:: get_hour() -> int .. method:: get_microsecond() -> int .. method:: get_minute() -> int .. method:: get_month() -> int .. method:: get_second() -> int .. method:: get_seconds() -> float .. method:: get_timezone() -> ~gi.repository.GLib.TimeZone .. method:: get_timezone_abbreviation() -> str .. method:: get_utc_offset() -> int .. method:: get_week_numbering_year() -> int .. method:: get_week_of_year() -> int .. method:: get_year() -> int .. method:: get_ymd() -> tuple[int, int, int] .. method:: hash() -> int .. method:: is_daylight_savings() -> bool .. method:: to_local() -> ~gi.repository.GLib.DateTime | None .. method:: to_timeval(tv: ~gi.repository.GLib.TimeVal) -> bool :param tv: .. method:: to_timezone(tz: ~gi.repository.GLib.TimeZone) -> ~gi.repository.GLib.DateTime | None :param tz: .. method:: to_unix() -> int .. method:: to_unix_usec() -> int .. method:: to_utc() -> ~gi.repository.GLib.DateTime | None