## ZeitgeistTimeRange ZeitgeistTimeRange — Immutable representation of an interval in time, marked by a beginning and an end |

## Synopsis

    #include <zeitgeist.h>

                        ZeitgeistTimeRange;
    struct              ZeitgeistTimeRangeClass;
    ZeitgeistTimeRange * zeitgeist_time_range_new           (gint64 start_msec,
                                                             gint64 end_msec);
    ZeitgeistTimeRange* zeitgeist_time_range_new_from_variant
                                                            (GVariant *time_range);
    ZeitgeistTimeRange * zeitgeist_time_range_new_from_now  (void);
    ZeitgeistTimeRange * zeitgeist_time_range_new_to_now    (void);
    ZeitgeistTimeRange * zeitgeist_time_range_new_anytime   (void);
    gint64              zeitgeist_time_range_get_start      (ZeitgeistTimeRange *time_range);
    gint64              zeitgeist_time_range_get_end        (ZeitgeistTimeRange *time_range);
    gchar *             zeitgeist_time_range_get_start_iso8601
                                                            (ZeitgeistTimeRange *time_range);
    gchar *             zeitgeist_time_range_get_end_iso8601
                                                            (ZeitgeistTimeRange *time_range);
    GVariant *          zeitgeist_time_range_to_variant     (ZeitgeistTimeRange *time_range);
    #define             ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE
    #define             ZEITGEIST_TIME_RANGE_VARIANT_TYPE

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ZeitgeistTimeRange

## Description

ZeitgeistTimeRange is a light, immutable, encapsulation of an interval in time, marked by a beginning and an end.

Time ranges are sub classes of GInitiallyUnowned which means that you may pass them directly to methods provided by the Zeitgeist library and forget about them. The callee will own the floating reference.

## Details

### ZeitgeistTimeRange

    typedef struct _ZeitgeistTimeRange ZeitgeistTimeRange;

### struct ZeitgeistTimeRangeClass

    struct ZeitgeistTimeRangeClass {
      GInitiallyUnownedClass parent_class;
    };

### zeitgeist_time_range_new ()

    ZeitgeistTimeRange * zeitgeist_time_range_new           (gint64 start_msec,
                                                             gint64 end_msec);

`start_msec` : | Starting timestamp in number of milliseconds since the Unix Epoch
`end_msec` : | Ending timestamp in number of milliseconds since the Unix Epoch
Returns : | A newly allocated ZeitgeistTimeRange. Free with `g_object_unref()`.

### zeitgeist_time_range_new_from_variant ()

    ZeitgeistTimeRange* zeitgeist_time_range_new_from_variant
                                                            (GVariant *time_range);

Create a ZeitgeistTimeRane from a GVariant

`time_range` : | A GVariant with signature ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE. If `time_range` is a floating reference this method will assume ownership of it
Returns : | A floating reference to a newly created ZeitgeistTimeRange

### zeitgeist_time_range_new_from_now ()

    ZeitgeistTimeRange * zeitgeist_time_range_new_from_now  (void);

Returns : | A new time range starting from the moment of invocation to the end of time

### zeitgeist_time_range_new_to_now ()

    ZeitgeistTimeRange * zeitgeist_time_range_new_to_now    (void);

Returns : | A new time range starting from the beginning of the Unix Epoch ending at the moment of invocation

### zeitgeist_time_range_new_anytime ()

    ZeitgeistTimeRange * zeitgeist_time_range_new_anytime   (void);

Returns : | A new time range starting from the beginning of the Unix Epoch stretching to the end of time

### zeitgeist_time_range_get_start ()

    gint64              zeitgeist_time_range_get_start      (ZeitgeistTimeRange *time_range);

`time_range` : | The time range to inspect
Returns : | The starting timestamp of the time range in miiliseconds since the Unix Epoch

### zeitgeist_time_range_get_end ()

    gint64              zeitgeist_time_range_get_end        (ZeitgeistTimeRange *time_range);

`time_range` : | The time range to inspect
Returns : | The ending timestamp of the time range in miiliseconds since the Unix Epoch

### zeitgeist_time_range_get_start_iso8601 ()

    gchar *             zeitgeist_time_range_get_start_iso8601
                                                            (ZeitgeistTimeRange *time_range);

Converts the a timestamp to a human readable format. Eg. 1970-01-01T00:00:00Z or 2010-04-09T07:24:08.082000Z. Note that the timezone of the formatted string will always be UTC disregarding locale.

`time_range` : | The time range to extract the start timestamp from
Returns : | A newly allocated string containing the timestamp formatted according to ISO-8601. Free with `g_free()`.

### zeitgeist_time_range_get_end_iso8601 ()

    gchar *             zeitgeist_time_range_get_end_iso8601
                                                            (ZeitgeistTimeRange *time_range);

Converts the a timestamp to a human readable format. Eg. 1970-01-01T00:00:00Z or 2010-04-09T07:24:08.082000Z. Note that the timezone of the formatted string will always be UTC disregarding locale.

`time_range` : | The time range to extract the end timestamp from
Returns : | A newly allocated string containing the timestamp formatted according to ISO-8601. Free with `g_free()`.

### zeitgeist_time_range_to_variant ()

    GVariant *          zeitgeist_time_range_to_variant     (ZeitgeistTimeRange *time_range);

`time_range` : | A ZeitgeistTimeRange. If the reference is floating this method will assume ownership of it
Returns : | A floating reference to a GVariant with signature ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE

### ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE

    #define ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE "(xx)"

The GVariant signature of a serialized ZeitgeistTimeRange

### ZEITGEIST_TIME_RANGE_VARIANT_TYPE

    #define ZEITGEIST_TIME_RANGE_VARIANT_TYPE G_VARIANT_TYPE(ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE)

The GVariantType of a serialized ZeitgeistTimeRange