Table of Contents

Class DateTime

Namespace
GLib
Assembly
GLib-2.0.dll
public sealed class DateTime : BoxedRecord, IEquatable<DateTime>
Inheritance
DateTime
Implements
Inherited Members

Constructors

DateTime(DateTimeOwnedHandle)

public DateTime(DateTimeOwnedHandle handle)

Parameters

handle DateTimeOwnedHandle

Properties

Handle

public DateTimeOwnedHandle Handle { get; }

Property Value

DateTimeOwnedHandle

Methods

Add(TimeSpan)

[Version("2.26")]
public DateTime? Add(TimeSpan timespan)

Parameters

timespan TimeSpan

Returns

DateTime

AddDays(int)

[Version("2.26")]
public DateTime? AddDays(int days)

Parameters

days int

Returns

DateTime

AddFull(int, int, int, int, int, double)

[Version("2.26")]
public DateTime? AddFull(int years, int months, int days, int hours, int minutes, double seconds)

Parameters

years int
months int
days int
hours int
minutes int
seconds double

Returns

DateTime

AddHours(int)

[Version("2.26")]
public DateTime? AddHours(int hours)

Parameters

hours int

Returns

DateTime

AddMinutes(int)

[Version("2.26")]
public DateTime? AddMinutes(int minutes)

Parameters

minutes int

Returns

DateTime

AddMonths(int)

[Version("2.26")]
public DateTime? AddMonths(int months)

Parameters

months int

Returns

DateTime

AddSeconds(double)

[Version("2.26")]
public DateTime? AddSeconds(double seconds)

Parameters

seconds double

Returns

DateTime

AddWeeks(int)

[Version("2.26")]
public DateTime? AddWeeks(int weeks)

Parameters

weeks int

Returns

DateTime

AddYears(int)

[Version("2.26")]
public DateTime? AddYears(int years)

Parameters

years int

Returns

DateTime

Compare(DateTime)

[Version("2.26")]
public int Compare(DateTime dt2)

Parameters

dt2 DateTime

Returns

int

Difference(DateTime)

[Version("2.26")]
public TimeSpan Difference(DateTime begin)

Parameters

begin DateTime

Returns

TimeSpan

Equal(DateTime)

[Version("2.26")]
public bool Equal(DateTime dt2)

Parameters

dt2 DateTime

Returns

bool

Equals(DateTime?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(DateTime? other)

Parameters

other DateTime

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Format(string)

[Version("2.26")]
public string? Format(string format)

Parameters

format string

Returns

string

FormatIso8601()

[Version("2.62")]
public string? FormatIso8601()

Returns

string

GetDayOfMonth()

[Version("2.26")]
public int GetDayOfMonth()

Returns

int

GetDayOfWeek()

[Version("2.26")]
public int GetDayOfWeek()

Returns

int

GetDayOfYear()

[Version("2.26")]
public int GetDayOfYear()

Returns

int

GetGType()

public static Type GetGType()

Returns

Type

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetHour()

[Version("2.26")]
public int GetHour()

Returns

int

GetMicrosecond()

[Version("2.26")]
public int GetMicrosecond()

Returns

int

GetMinute()

[Version("2.26")]
public int GetMinute()

Returns

int

GetMonth()

[Version("2.26")]
public int GetMonth()

Returns

int

GetSecond()

[Version("2.26")]
public int GetSecond()

Returns

int

GetSeconds()

[Version("2.26")]
public double GetSeconds()

Returns

double

GetTimezone()

[Version("2.58")]
public TimeZone GetTimezone()

Returns

TimeZone

GetTimezoneAbbreviation()

[Version("2.26")]
public string GetTimezoneAbbreviation()

Returns

string

GetUtcOffset()

[Version("2.26")]
public TimeSpan GetUtcOffset()

Returns

TimeSpan

GetWeekNumberingYear()

[Version("2.26")]
public int GetWeekNumberingYear()

Returns

int

GetWeekOfYear()

[Version("2.26")]
public int GetWeekOfYear()

Returns

int

GetYear()

[Version("2.26")]
public int GetYear()

Returns

int

GetYmd(out int, out int, out int)

[Version("2.26")]
public void GetYmd(out int year, out int month, out int day)

Parameters

year int
month int
day int

Hash()

[Version("2.26")]
public uint Hash()

Returns

uint

IsDaylightSavings()

[Version("2.26")]
public bool IsDaylightSavings()

Returns

bool

New(TimeZone, int, int, int, int, int, double)

[Version("2.26")]
public static DateTime? New(TimeZone tz, int year, int month, int day, int hour, int minute, double seconds)

Parameters

tz TimeZone
year int
month int
day int
hour int
minute int
seconds double

Returns

DateTime

NewFromIso8601(string, TimeZone?)

[Version("2.56")]
public static DateTime? NewFromIso8601(string text, TimeZone? defaultTz)

Parameters

text string
defaultTz TimeZone

Returns

DateTime

NewFromTimevalLocal(TimeVal)

[Version("2.26")]
public static DateTime? NewFromTimevalLocal(TimeVal tv)

Parameters

tv TimeVal

Returns

DateTime

NewFromTimevalUtc(TimeVal)

[Version("2.26")]
public static DateTime? NewFromTimevalUtc(TimeVal tv)

Parameters

tv TimeVal

Returns

DateTime

NewFromUnixLocal(long)

[Version("2.26")]
public static DateTime? NewFromUnixLocal(long t)

Parameters

t long

Returns

DateTime

NewFromUnixLocalUsec(long)

[Version("2.80")]
public static DateTime? NewFromUnixLocalUsec(long usecs)

Parameters

usecs long

Returns

DateTime

NewFromUnixUtc(long)

[Version("2.26")]
public static DateTime? NewFromUnixUtc(long t)

Parameters

t long

Returns

DateTime

NewFromUnixUtcUsec(long)

[Version("2.80")]
public static DateTime? NewFromUnixUtcUsec(long usecs)

Parameters

usecs long

Returns

DateTime

NewLocal(int, int, int, int, int, double)

[Version("2.26")]
public static DateTime? NewLocal(int year, int month, int day, int hour, int minute, double seconds)

Parameters

year int
month int
day int
hour int
minute int
seconds double

Returns

DateTime

NewNow(TimeZone)

[Version("2.26")]
public static DateTime? NewNow(TimeZone tz)

Parameters

tz TimeZone

Returns

DateTime

NewNowLocal()

[Version("2.26")]
public static DateTime? NewNowLocal()

Returns

DateTime

NewNowUtc()

[Version("2.26")]
public static DateTime? NewNowUtc()

Returns

DateTime

NewUtc(int, int, int, int, int, double)

[Version("2.26")]
public static DateTime? NewUtc(int year, int month, int day, int hour, int minute, double seconds)

Parameters

year int
month int
day int
hour int
minute int
seconds double

Returns

DateTime

Ref()

[Version("2.26")]
public DateTime Ref()

Returns

DateTime

ToLocal()

[Version("2.26")]
public DateTime? ToLocal()

Returns

DateTime

ToTimeval(TimeVal)

[Version("2.26")]
public bool ToTimeval(TimeVal tv)

Parameters

tv TimeVal

Returns

bool

ToTimezone(TimeZone)

[Version("2.26")]
public DateTime? ToTimezone(TimeZone tz)

Parameters

tz TimeZone

Returns

DateTime

ToUnix()

[Version("2.26")]
public long ToUnix()

Returns

long

ToUnixUsec()

[Version("2.80")]
public long ToUnixUsec()

Returns

long

ToUtc()

[Version("2.26")]
public DateTime? ToUtc()

Returns

DateTime

Unref()

[Version("2.26")]
public void Unref()