Logo Search packages:      
Sourcecode: libical version File versions  Download package

icaltime.h File Reference

Detailed Description

struct icaltimetype is a pseudo-object that abstracts time handling.

It can represent either a DATE or a DATE-TIME (floating, UTC or in a given timezone), and it keeps track internally of its native timezone.

The typical usage is to call the correct constructor specifying the desired timezone. If this is not known until a later time, the correct behavior is to specify a NULL timezone and call icaltime_convert_to_zone() at a later time.

There are several ways to create a new icaltimetype:

italtimetype objects can be converted to different formats:

Accessor methods include:

Query methods include:

Modify, compare and utility methods include:

Definition in file icaltime.h.

#include <time.h>

Go to the source code of this file.


struct  icaltime_span
struct  icaltimetype


typedef struct icaltime_span icaltime_span
typedef struct icaltimetype icaltimetype
typedef struct _icaltimezone icaltimezone


void icaltime_adjust (struct icaltimetype *tt, const int days, const int hours, const int minutes, const int seconds)
 Internal, shouldn't be part of the public API.
const char * icaltime_as_ical_string (const struct icaltimetype tt)
time_t icaltime_as_timet (const struct icaltimetype)
 Return the time as seconds past the UNIX epoch.
time_t icaltime_as_timet_with_zone (const struct icaltimetype tt, const icaltimezone *zone)
 Return the time as seconds past the UNIX epoch, using the given timezone.
int icaltime_compare (const struct icaltimetype a, const struct icaltimetype b)
int icaltime_compare_date_only (const struct icaltimetype a, const struct icaltimetype b)
int icaltime_compare_with_zone (const struct icaltimetype a, const struct icaltimetype b)
struct icaltimetype icaltime_convert_to_zone (const struct icaltimetype tt, icaltimezone *zone)
 Convert time to a given timezone.
struct icaltimetype icaltime_current_time_with_zone (const icaltimezone *zone)
 Convenience constructor.
int icaltime_day_of_week (const struct icaltimetype t)
int icaltime_day_of_year (const struct icaltimetype t)
int icaltime_days_in_month (const int month, const int year)
struct icaltimetype icaltime_from_day_of_year (const int doy, const int year)
struct icaltimetype icaltime_from_string (const char *str)
struct icaltimetype icaltime_from_string_with_zone (const char *str, const icaltimezone *zone)
struct icaltimetype icaltime_from_timet (const time_t v, const int is_date)
 Constructor (deprecated).
struct icaltimetype icaltime_from_timet_with_zone (const time_t tm, const int is_date, const icaltimezone *zone)
struct icaltimetype icaltime_from_week_number (const int week_number, const int year)
 Contructor (TODO). Create a new time from a weeknumber and a year.
const icaltimezone * icaltime_get_timezone (const struct icaltimetype t)
 Return the timezone.
char * icaltime_get_tzid (const struct icaltimetype t)
 Return the tzid, or NULL for a floating time.
int icaltime_is_date (const struct icaltimetype t)
 Returns true if time is of DATE type, false if DATE-TIME.
int icaltime_is_floating (const struct icaltimetype t)
 Returns true if time is a floating time.
int icaltime_is_null_time (const struct icaltimetype t)
int icaltime_is_utc (const struct icaltimetype t)
 Returns true if time is relative to UTC zone.
int icaltime_is_valid_time (const struct icaltimetype t)
struct icaltimetype icaltime_normalize (const struct icaltimetype t)
struct icaltimetype icaltime_null_date (void)
struct icaltimetype icaltime_null_time (void)
struct icaltimetype icaltime_set_timezone (struct icaltimetype *t, const icaltimezone *zone)
 Set the timezone.
int icaltime_span_contains (icaltime_span *s, icaltime_span *container)
 Returns true if the span is totally within the containing span.
struct icaltime_span icaltime_span_new (struct icaltimetype dtstart, struct icaltimetype dtend, int is_busy)
 calculate an icaltimespan given a start and end time.
int icaltime_span_overlaps (icaltime_span *s1, icaltime_span *s2)
 Returns true if the two spans overlap.
int icaltime_start_doy_of_week (const struct icaltimetype t)
struct icaltimetype icaltime_today (void)
 Convenience constructor.
int icaltime_week_number (const struct icaltimetype t)

Generated by  Doxygen 1.6.0   Back to index