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 %SoupDate represents a "floating" time with no associated timezone information.

Constructors

this
this(SoupDate* soupDate, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(int year, int month, int day, int hour, int minute, int second)

Creates a #SoupDate representing the indicated time, UTC.

this
this(int offsetSeconds)

Creates a #SoupDate representing a time @offset_seconds after the current time (or before it, if @offset_seconds is negative). If offset_seconds is 0, returns the current time.

this
this(string dateString)

Parses @date_string and tries to extract a date from it. This recognizes all of the "HTTP-date" formats from RFC 2616, all ISO 8601 formats containing both a time and a date, RFC 2822 dates, and reasonable approximations thereof. (Eg, it is lenient about whitespace, leading "0"s, etc.)

this
this(uint when)

Creates a #SoupDate corresponding to @when

Destructor

~this
~this()
Undocumented in source.

Members

Functions

copy
Date copy()

Copies @date.

free
void free()

Frees @date.

getDateStruct
SoupDate* getDateStruct(bool transferOwnership)

Get the main Gtk struct

getDay
int getDay()

Gets @date's day.

getHour
int getHour()

Gets @date's hour.

getMinute
int getMinute()

Gets @date's minute.

getMonth
int getMonth()

Gets @date's month.

getOffset
int getOffset()

Gets @date's offset from UTC.

getSecond
int getSecond()

Gets @date's second.

getStruct
void* getStruct()

the main Gtk struct as a void*

getUtc
int getUtc()

Gets @date's UTC flag

getYear
int getYear()

Gets @date's year.

isPast
bool isPast()

Determines if @date is in the past.

toString
string toString(SoupDateFormat format)

Converts @date to a string in the format described by @format.

toTimeval
void toTimeval(TimeVal time)

Converts @date to a #GTimeVal.

to_time_t
uint to_time_t()

Converts @date to a <type>time_t</type>, assumming it to be in UTC.

Properties

day
int day [@property getter]
int day [@property setter]

day of the month, 1 to 31

hour
int hour [@property getter]
int hour [@property setter]

hour of the day, 0 to 23

minute
int minute [@property getter]
int minute [@property setter]

minute, 0 to 59

month
int month [@property getter]
int month [@property setter]

the month, 1 to 12

offset
int offset [@property getter]
int offset [@property setter]

offset from UTC

second
int second [@property getter]
int second [@property setter]

second, 0 to 59 (or up to 61 in the case of leap seconds)

utc
bool utc [@property getter]
bool utc [@property setter]

%TRUE if the date is in UTC

year
int year [@property getter]
int year [@property setter]

the year, 1 to 9999

Static functions

getType
GType getType()

Variables

ownedRef
bool ownedRef;
Undocumented in source.
soupDate
SoupDate* soupDate;

the main Gtk struct

Meta