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
Methods
Add(TimeSpan)
[Version("2.26")]
public DateTime? Add(TimeSpan timespan)
Parameters
timespan
TimeSpan
Returns
AddDays(int)
[Version("2.26")]
public DateTime? AddDays(int days)
Parameters
days
int
Returns
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
Returns
AddHours(int)
[Version("2.26")]
public DateTime? AddHours(int hours)
Parameters
hours
int
Returns
AddMinutes(int)
[Version("2.26")]
public DateTime? AddMinutes(int minutes)
Parameters
minutes
int
Returns
AddMonths(int)
[Version("2.26")]
public DateTime? AddMonths(int months)
Parameters
months
int
Returns
AddSeconds(double)
[Version("2.26")]
public DateTime? AddSeconds(double seconds)
Parameters
seconds
double
Returns
AddWeeks(int)
[Version("2.26")]
public DateTime? AddWeeks(int weeks)
Parameters
weeks
int
Returns
AddYears(int)
[Version("2.26")]
public DateTime? AddYears(int years)
Parameters
years
int
Returns
Compare(DateTime)
[Version("2.26")]
public int Compare(DateTime dt2)
Parameters
dt2
DateTime
Returns
Difference(DateTime)
[Version("2.26")]
public TimeSpan Difference(DateTime begin)
Parameters
begin
DateTime
Returns
Equal(DateTime)
[Version("2.26")]
public bool Equal(DateTime dt2)
Parameters
dt2
DateTime
Returns
Equals(DateTime?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(DateTime? other)
Parameters
other
DateTimeAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
Format(string)
[Version("2.26")]
public string? Format(string format)
Parameters
format
string
Returns
FormatIso8601()
[Version("2.62")]
public string? FormatIso8601()
Returns
GetDayOfMonth()
[Version("2.26")]
public int GetDayOfMonth()
Returns
GetDayOfWeek()
[Version("2.26")]
public int GetDayOfWeek()
Returns
GetDayOfYear()
[Version("2.26")]
public int GetDayOfYear()
Returns
GetGType()
public static Type GetGType()
Returns
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
GetMicrosecond()
[Version("2.26")]
public int GetMicrosecond()
Returns
GetMinute()
[Version("2.26")]
public int GetMinute()
Returns
GetMonth()
[Version("2.26")]
public int GetMonth()
Returns
GetSecond()
[Version("2.26")]
public int GetSecond()
Returns
GetSeconds()
[Version("2.26")]
public double GetSeconds()
Returns
GetTimezone()
[Version("2.58")]
public TimeZone GetTimezone()
Returns
GetTimezoneAbbreviation()
[Version("2.26")]
public string GetTimezoneAbbreviation()
Returns
GetUtcOffset()
[Version("2.26")]
public TimeSpan GetUtcOffset()
Returns
GetWeekNumberingYear()
[Version("2.26")]
public int GetWeekNumberingYear()
Returns
GetWeekOfYear()
[Version("2.26")]
public int GetWeekOfYear()
Returns
GetYear()
[Version("2.26")]
public int GetYear()
Returns
GetYmd(out int, out int, out int)
[Version("2.26")]
public void GetYmd(out int year, out int month, out int day)
Parameters
Hash()
[Version("2.26")]
public uint Hash()
Returns
IsDaylightSavings()
[Version("2.26")]
public bool IsDaylightSavings()
Returns
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
Returns
NewFromIso8601(string, TimeZone?)
[Version("2.56")]
public static DateTime? NewFromIso8601(string text, TimeZone? defaultTz)
Parameters
Returns
NewFromTimevalLocal(TimeVal)
[Version("2.26")]
public static DateTime? NewFromTimevalLocal(TimeVal tv)
Parameters
tv
TimeVal
Returns
NewFromTimevalUtc(TimeVal)
[Version("2.26")]
public static DateTime? NewFromTimevalUtc(TimeVal tv)
Parameters
tv
TimeVal
Returns
NewFromUnixLocal(long)
[Version("2.26")]
public static DateTime? NewFromUnixLocal(long t)
Parameters
t
long
Returns
NewFromUnixLocalUsec(long)
[Version("2.80")]
public static DateTime? NewFromUnixLocalUsec(long usecs)
Parameters
usecs
long
Returns
NewFromUnixUtc(long)
[Version("2.26")]
public static DateTime? NewFromUnixUtc(long t)
Parameters
t
long
Returns
NewFromUnixUtcUsec(long)
[Version("2.80")]
public static DateTime? NewFromUnixUtcUsec(long usecs)
Parameters
usecs
long
Returns
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
Returns
NewNow(TimeZone)
[Version("2.26")]
public static DateTime? NewNow(TimeZone tz)
Parameters
tz
TimeZone
Returns
NewNowLocal()
[Version("2.26")]
public static DateTime? NewNowLocal()
Returns
NewNowUtc()
[Version("2.26")]
public static DateTime? NewNowUtc()
Returns
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
Returns
Ref()
[Version("2.26")]
public DateTime Ref()
Returns
ToLocal()
[Version("2.26")]
public DateTime? ToLocal()
Returns
ToTimeval(TimeVal)
[Version("2.26")]
public bool ToTimeval(TimeVal tv)
Parameters
tv
TimeVal
Returns
ToTimezone(TimeZone)
[Version("2.26")]
public DateTime? ToTimezone(TimeZone tz)
Parameters
tz
TimeZone
Returns
ToUnix()
[Version("2.26")]
public long ToUnix()
Returns
ToUnixUsec()
[Version("2.80")]
public long ToUnixUsec()
Returns
ToUtc()
[Version("2.26")]
public DateTime? ToUtc()
Returns
Unref()
[Version("2.26")]
public void Unref()