Top | ![]() |
![]() |
![]() |
![]() |
guint8 | jana_time_get_seconds () |
guint8 | jana_time_get_minutes () |
guint8 | jana_time_get_hours () |
guint8 | jana_time_get_day () |
guint8 | jana_time_get_month () |
guint16 | jana_time_get_year () |
gboolean | jana_time_get_isdate () |
gboolean | jana_time_get_daylight () |
gchar * | jana_time_get_tzname () |
glong | jana_time_get_offset () |
void | jana_time_set_seconds () |
void | jana_time_set_minutes () |
void | jana_time_set_hours () |
void | jana_time_set_day () |
void | jana_time_set_month () |
void | jana_time_set_year () |
void | jana_time_set_isdate () |
void | jana_time_set_tzname () |
void | jana_time_set_offset () |
JanaTime * | jana_time_duplicate () |
JanaDuration * | jana_duration_new () |
JanaDuration * | jana_duration_copy () |
void | jana_duration_set_start () |
void | jana_duration_set_end () |
gboolean | jana_duration_valid () |
void | jana_duration_free () |
JanaTime is the interface for representing a time. It has functions to set all the components of a basic calendar time, including date and timezone.
guint8
jana_time_get_seconds (JanaTime *self
);
Get the seconds component of the time. See jana_time_set_seconds()
.
guint8
jana_time_get_minutes (JanaTime *self
);
Get the minutes component of the time. See jana_time_set_minutes()
.
guint8
jana_time_get_hours (JanaTime *self
);
Get the hours component of the time. See jana_time_set_hours()
.
guint8
jana_time_get_day (JanaTime *self
);
Get the day component of the time. See jana_time_set_day()
.
guint8
jana_time_get_month (JanaTime *self
);
Get the month component of the time. See jana_time_set_month()
.
guint16
jana_time_get_year (JanaTime *self
);
Get the year component of the time. See jana_time_set_year()
.
gboolean
jana_time_get_isdate (JanaTime *self
);
Determines whether the time has been set as a date-only time. See
jana_time_set_isdate()
.
gboolean
jana_time_get_daylight (JanaTime *self
);
Determines whether the time is in daylight savings or not. See
jana_time_set_daylight()
.
gchar *
jana_time_get_tzname (JanaTime *self
);
Retrieves the timezone of the time. See jana_time_set_tzname()
.
glong
jana_time_get_offset (JanaTime *self
);
Gets the UTC (Universal Time Co-ordinated) offset of the time, in seconds.
See jana_time_set_offset()
.
void jana_time_set_seconds (JanaTime *self
,gint seconds
);
Sets the seconds component of the time. If the seconds parameter is invalid, the time will be normalised. For example, a seconds parameter of -1 would cause the minutes to be decreased by 1 and the seconds to be set to 59. If normalisation causes the time to cross the daylight savings boundary of the set timezone, the time will be adjusted accordingly.
void jana_time_set_minutes (JanaTime *self
,gint minutes
);
Sets the minutes component of the time. If the minutes parameter is invalid, the time will be normalised. For example, a minutes parameter of -1 would cause the hours to be decreased by 1 and the minutes to be set to 59. If normalisation causes the time to cross the daylight savings boundary of the set timezone, the time will be adjusted accordingly.
void jana_time_set_hours (JanaTime *self
,gint hours
);
Sets the hours component of the time. If the hours parameter is invalid, the time will be normalised. For example, an hours parameter of -1 would cause the date to be decreased by 1 day and the hours to be set to 23. If normalisation causes the time to cross the daylight savings boundary of the set timezone, the time will be adjusted accordingly.
void jana_time_set_day (JanaTime *self
,gint day
);
Sets the day component of the time. If the day parameter is invalid, the time will be normalised. For example, a day parameter of 0 would cause the date to be set to the last day of the previous month. If normalisation causes the time to cross the daylight savings boundary of the set timezone, the time will be adjusted accordingly.
void jana_time_set_month (JanaTime *self
,gint month
);
Sets the month component of the time. If the day parameter is invalid, the time will be normalised. For example, a month parameter of 0 would cause the date to be set to the last month of the previous year. If normalisation causes the time to cross the daylight savings boundary of the set timezone, the time will be adjusted accordingly.
void jana_time_set_year (JanaTime *self
,gint year
);
Sets the year component of the time. The time may be normalised in the situation that the year is adjusted from a leap year to a non-leap year and the month and day was set to the 29th of February. In this situation, the month and day would be adjusted to the 1st of March.
void jana_time_set_isdate (JanaTime *self
,gboolean isdate
);
Sets whether the time should be considered only as a date. The seconds,
minutes and hours components of the time are not guaranteed to be
preserved when isdate
is TRUE
.
void jana_time_set_tzname (JanaTime *self
,const gchar *tzname
);
Sets the timezone of the time. The time offset will also be adjusted to an offset that corresponds to the newly set timezone. If there is an offset for the newly set timezone that is the same as the previously set offset, the offset will remain unchanged. In addition, the time will be adjusted by the difference between the old offset and the new offset.
void jana_time_set_offset (JanaTime *self
,glong offset
);
Sets the offset of the time. The timezone will also be adjusted to a zone that corresponds to the newly set offset. If there is a zone for the newly set offset that is the same as the previously set zone, the zone will remain unchanged. In addition, the time will be adjusted by the difference between the old offset and the new offset.
JanaDuration * jana_duration_new (JanaTime *start
,JanaTime *end
);
Creates a new JanaDuration.
JanaDuration *
jana_duration_copy (JanaDuration *duration
);
Create a copy of a JanaDuration.
void jana_duration_set_start (JanaDuration *self
,JanaTime *start
);
Sets the start of the duration.
void jana_duration_set_end (JanaDuration *self
,JanaTime *end
);
Sets the end of the duration.
gboolean
jana_duration_valid (JanaDuration *self
);
Determines whether the duration is valid. For the duration to be valid, the start and end must be set, and the end must occur on or after the start.
void
jana_duration_free (JanaDuration *self
);
Frees the memory associated with a JanaDuration.