Date
Object Hierarchy:
Soup.Date
Soup.Date
Soup.Date
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "soup_date_get_type ()" ) ] [ Compact ]public class Date
A date and time.
The date is assumed to be in the (proleptic) Gregorian calendar. The time is in UTC if utc
is true
. Otherwise,
the time is a local time, and offset
gives the offset from UTC in minutes (such that adding offset
to the time
would give the correct UTC time). If utc
is false
and offset
is 0, then the
Date represents a "floating" time with no associated timezone information.
Content:
Creation methods:
public Date (int year, int month, int day, int hour, int minute, int second)
Creates a Date representing the indicated
time, UTC.
public Date.from_now (int offset_seconds)
Creates a Date representing a time
offset_seconds
after the current time (or before it, if offset_seconds
is negative).
public Date.from_string (string date_string)
Parses date_string
and tries to extract a date from it.
public Date.from_time_t (time_t when)
Creates a Date corresponding to when
Methods:
public Date copy ()
Copies this .
public void free ()
Frees this .
public int get_day ()
Gets this 's day.
public int get_hour ()
Gets this 's hour.
public int get_minute ()
Gets this 's minute.
public int get_month ()
Gets this 's month.
public int get_offset ()
Gets this 's offset from UTC.
public int get_second ()
Gets this 's second.
public int get_utc ()
Gets this 's UTC flag
public int get_year ()
Gets this 's year.
public bool is_past ()
Determines if this is in the past.
public string to_string (DateFormat format)
Converts this to a string in the
format described by format
.
public time_t to_time_t ()
Converts this to a
time_t , assumming it to be in UTC.
public TimeVal to_timeval ()
Converts this to a
TimeVal .
Fields: