ICalGLib.Time¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class ICalGLib.Time(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
This is the
ICalGLib.Timeinstance.- classmethod days_in_month(month, year)¶
- Parameters:
- Returns:
The number of days in the target month in the target year.
- Return type:
Gets the number of days in the target month in the target year.
New in version 1.0.
- classmethod days_in_year(year)¶
-
Returns the number of days in this year.
New in version 2.0.
- classmethod days_is_leap_year(year)¶
-
Checks whether a year is a leap year.
New in version 1.0.
- classmethod new()¶
- Returns:
The newly created
ICalGLib.Time. It is a null time- Return type:
Creates a new
ICalGLib.Time.New in version 1.0.
- classmethod new_current_with_zone(zone)¶
- Parameters:
zone (
ICalGLib.TimezoneorNone) – The timezone used to create aICalGLib.Timeaccording to the current time- Returns:
The newly created
ICalGLib.Time- Return type:
Creates a
ICalGLib.Timeaccording to the timezone and current time.New in version 1.0.
- classmethod new_from_day_of_year(day, year)¶
- Parameters:
- Returns:
The newly created
ICalGLib.Time- Return type:
Creates a new time, given a day of year and a year.
New in version 1.0.
- classmethod new_from_string(str)¶
- Parameters:
str (
str) – The ISO format string- Returns:
The newly created
ICalGLib.Time- Return type:
Creates a time from an ISO format string.
New in version 1.0.
- classmethod new_from_timet_with_zone(v, is_date, zone)¶
- Parameters:
v (
int) – The seconds past since epoch timeis_date (
int) – Whether it is a date type, 1 if yes, 0 if notzone (
ICalGLib.TimezoneorNone) – The timezone, orNone
- Returns:
The newly created
ICalGLib.Time- Return type:
Converts seconds past UNIX epoch to a timetype, using timezones.
New in version 1.0.
- classmethod new_null_date()¶
- Returns:
The newly created
ICalGLib.Time- Return type:
Creates a null date, which indicates no time has been set.
New in version 1.0.
- classmethod new_null_time()¶
- Returns:
The newly created
ICalGLib.Time- Return type:
Creates a default time which is an epoch time.
New in version 1.0.
- classmethod new_today()¶
- Returns:
The newly created
ICalGLib.Time- Return type:
Creates a
ICalGLib.Timerepresenting today.New in version 1.0.
- classmethod timezone_expand_vtimezone(comp, end_year, changes)¶
- Parameters:
comp (
ICalGLib.Component) – TheICalGLib.Componentend_year (
int) – The end yearchanges (
ICalGLib.Array) – The changes to be applies
Applies a list of timezone changes on the array of components until the end year.
New in version 2.0.
- add(d)¶
- Parameters:
d (
ICalGLib.Duration) – AICalGLib.Durationas the difference- Returns:
The
ICalGLib.Timeresults. The native object is the same. But since it is a bare object, so it won’t cause segmentation.- Return type:
Adds a time duration on the time.
New in version 2.0.
- adjust(days, hours, minutes, seconds)¶
- Parameters:
Adds or subtracts a number of days, hours, minutes and seconds from self.
New in version 1.0.
- as_ical_string()¶
- Returns:
The string representation
- Return type:
Returns a string representation of the time, in RFC2445 format.
New in version 1.0.
- as_timet()¶
- Returns:
The time as seconds past the UNIX epoch
- Return type:
Returns the time as seconds past the UNIX epoch.
New in version 1.0.
- as_timet_with_zone(zone)¶
- Parameters:
zone (
ICalGLib.TimezoneorNone) – The timezone- Returns:
The time as seconds past the UNIX epoch
- Return type:
Returns the time as seconds past the UNIX epoch, using timezones.
New in version 1.0.
- clone()¶
- Returns:
The newly created
ICalGLib.Time, copy of self.- Return type:
Creates a new
ICalGLib.Time, copy of self.New in version 1.0.
- compare(b)¶
- Parameters:
b (
ICalGLib.Time) – TheICalGLib.Timeto be compared- Returns:
-1, 0, or 1 to indicate that a less than b, a==b or a larger than b.
- Return type:
ICalGLib.Time.comparereturns an integer indicating the result of the comparison, as follow:New in version 1.0.
- compare_date_only(b)¶
- Parameters:
b (
ICalGLib.Time) – TheICalGLib.Timeto be compared- Returns:
-1, 0, or 1 to indicate that a less than b, a==b or a larger than b.
- Return type:
Like
ICalGLib.Time.compare(), but only use the date parts.New in version 1.0.
- compare_date_only_tz(b, zone)¶
- Parameters:
b (
ICalGLib.Time) – TheICalGLib.Timeto be comparedzone (
ICalGLib.TimezoneorNone) – The target timezone
- Returns:
-1, 0, or 1 to indicate that a less than b, a==b or a larger than b.
- Return type:
Like i_cal_time_compare_tz(), but only use the date parts; accepts timezone.
New in version 1.0.
- convert_timezone(from_zone, to_zone)¶
- Parameters:
from_zone (
ICalGLib.TimezoneorNone) – From timezoneto_zone (
ICalGLib.TimezoneorNone) – To timezone
Convert time from one timezone to another.
New in version 1.0.
- convert_to_zone(zone)¶
- Parameters:
zone (
ICalGLib.TimezoneorNone) – The target timezone- Returns:
The converted
ICalGLib.Time- Return type:
Converts self to zone and return new
ICalGLib.Timeobject.New in version 1.0.
- convert_to_zone_inplace(zone)¶
- Parameters:
zone (
ICalGLib.TimezoneorNone) – The target timezone
Converts self to zone and store the result into self.
New in version 3.0.5.
- day_of_week()¶
- Returns:
The day of the week of the given time. Sunday is 1.
- Return type:
Returns the day of the week of the given time. Sunday is 1.
New in version 1.0.
- day_of_year()¶
- Returns:
The day of the year of the given time
- Return type:
Returns the day of the year of the given time.
New in version 1.0.
- get_date()¶
- Returns:
- year:
Out parameter for the ‘year’ part of the date
- month:
Out parameter for the ‘month’ part of the date
- day:
Out parameter for the ‘day’ part of the date
- Return type:
Gets the year/month/date parts of the self in one call.
New in version 1.0.
- get_day()¶
- Returns:
The day.
- Return type:
Gets the day of
ICalGLib.Time.New in version 1.0.
- get_hour()¶
- Returns:
The hour.
- Return type:
Gets the hour of
ICalGLib.Time.New in version 1.0.
- get_minute()¶
- Returns:
The minute.
- Return type:
Gets the minute of
ICalGLib.Time.New in version 1.0.
- get_month()¶
- Returns:
The month.
- Return type:
Gets the month of
ICalGLib.Time.New in version 1.0.
- get_second()¶
- Returns:
The second.
- Return type:
Gets the second of
ICalGLib.Time.New in version 1.0.
- get_time()¶
- Returns:
- hour:
Out parameter for the ‘hour’ part of the time
- minute:
Out parameter for the ‘minute’ part of the time
- second:
Out parameter for the ‘second’ part of the time
- Return type:
Gets the hour/minute/second parts of the self in one call.
New in version 1.0.
- get_timezone()¶
- Returns:
The timezone information
- Return type:
Returns the timezone, the
ICalGLib.Timezoneobject is cached and can be either unreferenced once the last instance is used or can be kept untilICalGLib.Object.free_global_objects() is called (usually at the very end of the program).New in version 1.0.
- get_tzid()¶
- Returns:
The tzid of
ICalGLib.Time, orNoneif floating type- Return type:
Returns the tzid, or
Nonefor a floating time.New in version 1.0.
- get_year()¶
- Returns:
The year.
- Return type:
Gets the year of
ICalGLib.Time.New in version 1.0.
- is_date()¶
- Returns:
True if time is of DATE type, false if DATE-TIME.
- Return type:
Returns true if time is of DATE type, false if DATE-TIME.
New in version 1.0.
- is_daylight()¶
- Returns:
The is_daylight.
- Return type:
Gets the is_daylight of
ICalGLib.Time.New in version 1.0.
- is_null_time()¶
- Returns:
Whether self is null_time. 1 if yes, 0 if not.
- Return type:
Returns true if the time is null.
New in version 1.0.
- is_utc()¶
- Returns:
True if time is relative to UTC zone.
- Return type:
Returns true if time is relative to UTC zone.
New in version 1.0.
- is_valid_time()¶
- Returns:
Whether self is null_time. 1 if yes, 0 if not.
- Return type:
Returns true if the time is null.
New in version 1.0.
- normalize()¶
- Returns:
The
ICalGLib.Timenormalized- Return type:
Normalizes the icaltime, so that all fields are within the normal range.
New in version 1.0.
- normalize_inplace()¶
Normalizes the self, so that all fields are within the normal range.
New in version 3.0.5.
- set_date(year, month, day)¶
- Parameters:
Sets the year/month/date parts of the self in one call. This doesn’t verify validity of the given date.
New in version 1.0.
- set_day(day)¶
- Parameters:
day (
int) – The day
Sets the day of
ICalGLib.Time.New in version 1.0.
- set_hour(hour)¶
- Parameters:
hour (
int) – The hour
Sets the hour of
ICalGLib.Time.New in version 1.0.
- set_is_date(is_date)¶
- Parameters:
is_date (
bool) – The is_date
Sets the is_date of
ICalGLib.Time.New in version 1.0.
- set_is_daylight(is_daylight)¶
- Parameters:
is_daylight (
bool) – The is_daylight
Sets the is_daylight of
ICalGLib.Time.New in version 1.0.
- set_minute(minute)¶
- Parameters:
minute (
int) – The minute
Sets the minute of
ICalGLib.Time.New in version 1.0.
- set_month(month)¶
- Parameters:
month (
int) – The month
Sets the month of
ICalGLib.Time.New in version 1.0.
- set_second(second)¶
- Parameters:
second (
int) – The second
Sets the second of
ICalGLib.Time.New in version 1.0.
- set_time(hour, minute, second)¶
- Parameters:
Sets the hour/minute/second parts of the self in one call. This doesn’t verify validity of the given time.
New in version 1.0.
- set_timezone(zone)¶
- Parameters:
zone (
ICalGLib.TimezoneorNone) – The timezone
Sets the timezone of the self.
New in version 1.0.
- set_year(year)¶
- Parameters:
year (
int) – The year
Sets the year of
ICalGLib.Time.New in version 1.0.
- start_doy_week(fdow)¶
- Parameters:
fdow (
int) – The first day of the week- Returns:
The day of the year for the Sunday of the week that the given time is within.
- Return type:
Returns the day of the year for the first day of the week that the given time is within.
New in version 1.0.
- subtract(t2)¶
- Parameters:
t2 (
ICalGLib.Time) – The subtractingICalGLib.Time- Returns:
The
ICalGLib.Durationbetween twoICalGLib.Time.- Return type:
Gets the duration between two time.
New in version 2.0.