DateTime

Overview

DateTime type used to store and work with date/time values.

Location

  • Reference:
    • Elements.dll  .NET, .NET Core 6.0, .NET Standard 2.0
    • elements.jar  Cooper
    • Elements.fx  Island, ToffeeV2
    • libElements.fx  Toffee
  • Namespace: RemObjects.Elements.RTL
  • Platforms: .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
  • Mapped to:
    • Calendar  Cooper
    • NSDate  Toffee, ToffeeV2


 

constructor .NET, .NET Core 6.0, .NET Standard 2.0

 

constructor

 

DateTime()

 

init()

 

Sub New()

constructor (Int64)

Creates a new object with a given number of ticks.

 

constructor(aTicks: Int64)

 

DateTime(Int64 aTicks)

 

init(_ aTicks: Int64)

 

DateTime(Int64 aTicks)

 

Sub New(aTicks As Int64)

Parameters:

  • aTicks:

constructor (Int32, Int32, Int32)

Creates a new object with a given date.

 

constructor(aYear: Int32; aMonth: Int32; aDay: Int32)

 

DateTime(Int32 aYear, Int32 aMonth, Int32 aDay)

 

init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32)

 

DateTime(Integer aYear, Integer aMonth, Integer aDay)

 

Sub New(aYear As Int32, aMonth As Int32, aDay As Int32)

Parameters:

  • aYear:
  • aMonth:
  • aDay:

constructor (Int32, Int32, Int32, Int32, Int32)

Creates a new object with a given date.

 

constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32)

 

DateTime(Int32 aYear, Int32 aMonth, Int32 aDay, Int32 anHour, Int32 aMinute)

 

init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32, _ anHour: Int32, _ aMinute: Int32)

 

DateTime(Integer aYear, Integer aMonth, Integer aDay, Integer anHour, Integer aMinute)

 

Sub New(aYear As Int32, aMonth As Int32, aDay As Int32, anHour As Int32, aMinute As Int32)

Parameters:

  • aYear:
  • aMonth:
  • aDay:
  • anHour:
  • aMinute:

constructor (Int32, Int32, Int32, Int32, Int32, Int32)

Creates a new object with a given date.

 

constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32; aSecond: Int32)

 

DateTime(Int32 aYear, Int32 aMonth, Int32 aDay, Int32 anHour, Int32 aMinute, Int32 aSecond)

 

init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32, _ anHour: Int32, _ aMinute: Int32, _ aSecond: Int32)

 

DateTime(Integer aYear, Integer aMonth, Integer aDay, Integer anHour, Integer aMinute, Integer aSecond)

 

Sub New(aYear As Int32, aMonth As Int32, aDay As Int32, anHour As Int32, aMinute As Int32, aSecond As Int32)

Parameters:

  • aYear:
  • aMonth:
  • aDay:
  • anHour:
  • aMinute:
  • aSecond:

constructor (Int32, Int32, Int32, Int32, Int32, Int32, Int32)

 

constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32; aSecond: Int32; aMSec: Int32)

 

DateTime(Int32 aYear, Int32 aMonth, Int32 aDay, Int32 anHour, Int32 aMinute, Int32 aSecond, Int32 aMSec)

 

init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32, _ anHour: Int32, _ aMinute: Int32, _ aSecond: Int32, _ aMSec: Int32)

 

DateTime(Integer aYear, Integer aMonth, Integer aDay, Integer anHour, Integer aMinute, Integer aSecond, Integer aMSec)

 

Sub New(aYear As Int32, aMonth As Int32, aDay As Int32, anHour As Int32, aMinute As Int32, aSecond As Int32, aMSec As Int32)

Parameters:

  • aYear:
  • aMonth:
  • aDay:
  • anHour:
  • aMinute:
  • aSecond:
  • aMSec:

Add

Add a timespan to a date, and returning the new date.

 

method Add(Value: TimeSpan): not nullable DateTime

 

DateTime! Add(TimeSpan Value)

 

func Add(_ Value: TimeSpan) -> DateTime

 

DateTime Add(TimeSpan Value)

 

Function Add(Value As TimeSpan) As DateTime

Parameters:

  • Value:

AddDays

Adds a nr of days and returns a new datetime.

 

method AddDays(Value: Int32): not nullable DateTime

 

DateTime! AddDays(Int32 Value)

 

func AddDays(_ Value: Int32) -> DateTime

 

DateTime AddDays(Integer Value)

 

Function AddDays(Value As Int32) As DateTime

Parameters:

  • Value:

AddHours

Adds a nr of hours and returns a new datetime.

 

method AddHours(Value: Int32): not nullable DateTime

 

DateTime! AddHours(Int32 Value)

 

func AddHours(_ Value: Int32) -> DateTime

 

DateTime AddHours(Integer Value)

 

Function AddHours(Value As Int32) As DateTime

Parameters:

  • Value:

AddMilliSeconds

Adds a nr of msec and returns a new datetime.

 

method AddMilliSeconds(Value: Int32): not nullable DateTime

 

DateTime! AddMilliSeconds(Int32 Value)

 

func AddMilliSeconds(_ Value: Int32) -> DateTime

 

DateTime AddMilliSeconds(Integer Value)

 

Function AddMilliSeconds(Value As Int32) As DateTime

Parameters:

  • Value:

AddMinutes

Adds a nr of minutes and returns a new datetime.

 

method AddMinutes(Value: Int32): not nullable DateTime

 

DateTime! AddMinutes(Int32 Value)

 

func AddMinutes(_ Value: Int32) -> DateTime

 

DateTime AddMinutes(Integer Value)

 

Function AddMinutes(Value As Int32) As DateTime

Parameters:

  • Value:

AddMonths

Adds a nr of months and returns a new datetime.

 

method AddMonths(Value: Int32): not nullable DateTime

 

DateTime! AddMonths(Int32 Value)

 

func AddMonths(_ Value: Int32) -> DateTime

 

DateTime AddMonths(Integer Value)

 

Function AddMonths(Value As Int32) As DateTime

Parameters:

  • Value:

AddSeconds

Adds a nr of seconds and returns a new datetime.

 

method AddSeconds(Value: Int32): not nullable DateTime

 

DateTime! AddSeconds(Int32 Value)

 

func AddSeconds(_ Value: Int32) -> DateTime

 

DateTime AddSeconds(Integer Value)

 

Function AddSeconds(Value As Int32) As DateTime

Parameters:

  • Value:

AddYears

Adds a nr of years and returns a new datetime.

 

method AddYears(Value: Int32): not nullable DateTime

 

DateTime! AddYears(Int32 Value)

 

func AddYears(_ Value: Int32) -> DateTime

 

DateTime AddYears(Integer Value)

 

Function AddYears(Value As Int32) As DateTime

Parameters:

  • Value:

Compare

Compares two dates, and returns 0 if the same, -1 if less, 1 if more.

 

class method Compare(Value1: DateTime; Value2: DateTime): Int32

 

static Int32 Compare(DateTime Value1, DateTime Value2)

 

static func Compare(_ Value1: DateTime, _ Value2: DateTime) -> Int32

 

static Integer Compare(DateTime Value1, DateTime Value2)

 

Shared Function Compare(Value1 As DateTime, Value2 As DateTime) As Int32

Parameters:

  • Value1:
  • Value2:

CompareTo (Object): Int32 Island

 

method CompareTo(other: Object): Int32

 

Int32 CompareTo(Object other)

 

func CompareTo(_ other: Object) -> Int32

 

Function CompareTo(other As Object) As Int32

Parameters:

  • other:

CompareTo (DateTime): Int32

Compares this date, and returns 0 if the same, -1 if less, 1 if more.

 

method CompareTo(Value: DateTime): Int32

 

Int32 CompareTo(DateTime Value)

 

func CompareTo(_ Value: DateTime) -> Int32

 

Integer CompareTo(DateTime Value)

 

Function CompareTo(Value As DateTime) As Int32

Parameters:

  • Value:

Date

Returns the date without time part.

 

property Date: DateTime read;

 

DateTime Date { get; }

 

var Date: DateTime { get{} }

 

DateTime Date { __get; }

 

ReadOnly Property Date() As DateTime

Day

Returns the day of the month (1..31)

 

property Day: Int32 read;

 

Int32 Day { get; }

 

var Day: Int32 { get{} }

 

Integer Day { __get; }

 

ReadOnly Property Day() As Int32

DayOfWeek

Returns the day of the week (1..7)

 

property DayOfWeek: Int32 read;

 

Int32 DayOfWeek { get; }

 

var DayOfWeek: Int32 { get{} }

 

Integer DayOfWeek { __get; }

 

ReadOnly Property DayOfWeek() As Int32

FromOADate

Converts an OLE date to a DateTime

 

class method FromOADate(aOADate: Double): not nullable DateTime

 

static DateTime! FromOADate(Double aOADate)

 

static func FromOADate(_ aOADate: Double) -> DateTime

 

static DateTime FromOADate(Double aOADate)

 

Shared Function FromOADate(aOADate As Double) As DateTime

Parameters:

  • aOADate:

FromUnixDate

 

class method FromUnixDate(aUnixDate: Int32): not nullable DateTime

 

static DateTime! FromUnixDate(Int32 aUnixDate)

 

static func FromUnixDate(_ aUnixDate: Int32) -> DateTime

 

static DateTime FromUnixDate(Integer aUnixDate)

 

Shared Function FromUnixDate(aUnixDate As Int32) As DateTime

Parameters:

  • aUnixDate:

Hour

Returns the hour (0..23)

 

property Hour: Int32 read;

 

Int32 Hour { get; }

 

var Hour: Int32 { get{} }

 

Integer Hour { __get; }

 

ReadOnly Property Hour() As Int32

IsUTC

 

property IsUTC: Boolean read;

 

Boolean IsUTC { get; }

 

var IsUTC: Boolean { get{} }

 

Boolean IsUTC { __get; }

 

ReadOnly Property IsUTC() As Boolean

Millisecond .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2

 

property Millisecond: Int32 read;

 

Int32 Millisecond { get; }

 

var Millisecond: Int32 { get{} }

 

ReadOnly Property Millisecond() As Int32

Minute

Returns the minutes in this datetime.

 

property Minute: Int32 read;

 

Int32 Minute { get; }

 

var Minute: Int32 { get{} }

 

Integer Minute { __get; }

 

ReadOnly Property Minute() As Int32

Month

Returns the month in this datetime.

 

property Month: Int32 read;

 

Int32 Month { get; }

 

var Month: Int32 { get{} }

 

Integer Month { __get; }

 

ReadOnly Property Month() As Int32

OffsetToUTC

 

property OffsetToUTC: Int32 read;

 

Int32 OffsetToUTC { get; }

 

var OffsetToUTC: Int32 { get{} }

 

Integer OffsetToUTC { __get; }

 

ReadOnly Property OffsetToUTC() As Int32

Second

Returns the seconds in this datetime.

 

property Second: Int32 read;

 

Int32 Second { get; }

 

var Second: Int32 { get{} }

 

Integer Second { __get; }

 

ReadOnly Property Second() As Int32

Ticks

Returns the nr of ticks, there are 10 000 000 ticks in a second.

 

property Ticks: Int64 read;

 

Int64 Ticks { get; }

 

var Ticks: Int64 { get{} }

 

Int64 Ticks { __get; }

 

ReadOnly Property Ticks() As Int64

TicksTill1970

 

const TicksTill1970: Int64 = 621355968000000000;

 

const Int64 TicksTill1970 = 621355968000000000

 

static let TicksTill1970: Int64 = 621355968000000000

 

static final Int64 TicksTill1970 = 621355968000000000

 

Dim TicksTill1970 As Int64 = 621355968000000000

TimeSince (DateTime): TimeSpan

Returns the time passed since a given datetime compared to the current one.

 

class method TimeSince(aOtherDateTime: DateTime): TimeSpan

 

static TimeSpan TimeSince(DateTime aOtherDateTime)

 

static func TimeSince(_ aOtherDateTime: DateTime) -> TimeSpan

 

static TimeSpan TimeSince(DateTime aOtherDateTime)

 

Shared Function TimeSince(aOtherDateTime As DateTime) As TimeSpan

Parameters:

  • aOtherDateTime:

TimeSince

Returns the time passed since a given datetime compared to now.

 

property TimeSince: TimeSpan read;

 

TimeSpan TimeSince { get; }

 

var TimeSince: TimeSpan { get{} }

 

TimeSpan TimeSince { __get; }

 

ReadOnly Property TimeSince() As TimeSpan

Today

Returns the current date without time part.

 

class property Today: not nullable DateTime read;

 

class DateTime! Today { get; }

 

static var Today: DateTime { get{} }

 

class DateTime Today { __get; }

 

Shared ReadOnly Property Today() As DateTime

ToISO8601String

 

method ToISO8601String(aFormat: ISO8601Format; aTimeZone: TimeZone): not nullable String

 

String! ToISO8601String(ISO8601Format aFormat, TimeZone aTimeZone)

 

func ToISO8601String(_ aFormat: ISO8601Format, _ aTimeZone: TimeZone) -> String

 

String ToISO8601String(ISO8601Format aFormat, TimeZone aTimeZone)

 

Function ToISO8601String(aFormat As ISO8601Format, aTimeZone As TimeZone) As String

Parameters:

  • aFormat:
  • aTimeZone:

ToLongPrettyDateString

Convert a date to string in a given timezone, long format.

 

method ToLongPrettyDateString(aTimeZone: TimeZone): not nullable String

 

String! ToLongPrettyDateString(TimeZone aTimeZone)

 

func ToLongPrettyDateString(_ aTimeZone: TimeZone) -> String

 

String ToLongPrettyDateString(TimeZone aTimeZone)

 

Function ToLongPrettyDateString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToOADate .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2

 

method ToOADate: Double

 

Double ToOADate()

 

func ToOADate() -> Double

 

Function ToOADate() As Double

ToOADate (not nullable DateTime): Double

Convert a datetime to Ole date (double).

 

class method ToOADate(aDateTime: not nullable DateTime): Double

 

static Double ToOADate(DateTime! aDateTime)

 

static func ToOADate(_ aDateTime: DateTime) -> Double

 

static Double ToOADate(DateTime aDateTime)

 

Shared Function ToOADate(aDateTime As DateTime) As Double

Parameters:

  • aDateTime:

ToShortDateString

Convert a date to string in a given timezone, short format.

 

method ToShortDateString(aTimeZone: TimeZone): not nullable String

 

String! ToShortDateString(TimeZone aTimeZone)

 

func ToShortDateString(_ aTimeZone: TimeZone) -> String

 

String ToShortDateString(TimeZone aTimeZone)

 

Function ToShortDateString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToShortPrettyDateAndTimeString

Convert a date and time to string in a given timezone, long format.

 

method ToShortPrettyDateAndTimeString(aTimeZone: TimeZone): not nullable String

 

String! ToShortPrettyDateAndTimeString(TimeZone aTimeZone)

 

func ToShortPrettyDateAndTimeString(_ aTimeZone: TimeZone) -> String

 

String ToShortPrettyDateAndTimeString(TimeZone aTimeZone)

 

Function ToShortPrettyDateAndTimeString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToShortPrettyDateString

Convert a date to string in a given timezone, short format.

 

method ToShortPrettyDateString(aTimeZone: TimeZone): not nullable String

 

String! ToShortPrettyDateString(TimeZone aTimeZone)

 

func ToShortPrettyDateString(_ aTimeZone: TimeZone) -> String

 

String ToShortPrettyDateString(TimeZone aTimeZone)

 

Function ToShortPrettyDateString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToShortTimeString

Convert a time to string in a given timezone, short format.

 

method ToShortTimeString(aTimeZone: TimeZone): not nullable String

 

String! ToShortTimeString(TimeZone aTimeZone)

 

func ToShortTimeString(_ aTimeZone: TimeZone) -> String

 

String ToShortTimeString(TimeZone aTimeZone)

 

Function ToShortTimeString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToString  override virtual .NET, .NET Core 6.0, .NET Standard 2.0, Island

Convert this datetime to stirng.

 

method ToString: PlatformString

 

PlatformString ToString()

 

func ToString() -> PlatformString

 

Function ToString() As PlatformString

ToString (TimeZone): not nullable String

Convert this datetime to stirng with a given timezone.

 

method ToString(aTimeZone: TimeZone): not nullable String

 

String! ToString(TimeZone aTimeZone)

 

func ToString(_ aTimeZone: TimeZone) -> String

 

String ToString(TimeZone aTimeZone)

 

Function ToString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToString (String, TimeZone): not nullable String

Convert this datetime to stirng with a given format and timezone.

 

method ToString(Format: String; aTimeZone: TimeZone): not nullable String

 

String! ToString(String Format, TimeZone aTimeZone)

 

func ToString(_ Format: String, _ aTimeZone: TimeZone) -> String

 

String ToString(String Format, TimeZone aTimeZone)

 

Function ToString(Format As String, aTimeZone As TimeZone) As String

Parameters:

  • Format:
  • aTimeZone:

ToString (String, String, TimeZone): not nullable String

Convert this datetime to stirng with a given format, culture and timezone.

 

method ToString(Format: String; Culture: String; aTimeZone: TimeZone): not nullable String

 

String! ToString(String Format, String Culture, TimeZone aTimeZone)

 

func ToString(_ Format: String, _ Culture: String, _ aTimeZone: TimeZone) -> String

 

String ToString(String Format, String Culture, TimeZone aTimeZone)

 

Function ToString(Format As String, Culture As String, aTimeZone As TimeZone) As String

Parameters:

  • Format:
  • Culture:
  • aTimeZone:

ToUnixDate .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2

 

method ToUnixDate: Int32

 

Int32 ToUnixDate()

 

func ToUnixDate() -> Int32

 

Function ToUnixDate() As Int32

ToUnixDate (not nullable DateTime): Int32

 

class method ToUnixDate(aDateTime: not nullable DateTime): Int32

 

static Int32 ToUnixDate(DateTime! aDateTime)

 

static func ToUnixDate(_ aDateTime: DateTime) -> Int32

 

static Integer ToUnixDate(DateTime aDateTime)

 

Shared Function ToUnixDate(aDateTime As DateTime) As Int32

Parameters:

  • aDateTime:

TryParse (String, String, Locale, DateParserOptions): nullable DateTime

Try to parse a date with a given format, locale and options.

 

class method TryParse(aDateTime: String; aFormat: String; aLocale: Locale; aOptions: DateParserOptions): nullable DateTime

 

static DateTime? TryParse(String aDateTime, String aFormat, Locale aLocale, DateParserOptions aOptions)

 

// Toffee
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime
// ToffeeV2
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime?

 

static DateTime TryParse(String aDateTime, String aFormat, Locale aLocale, DateParserOptions aOptions)

 

Shared Function TryParse(aDateTime As String, aFormat As String, aLocale As Locale, aOptions As DateParserOptions) As DateTime?

Parameters:

  • aDateTime:
  • aFormat:
  • aLocale:
  • aOptions:

TryParse (String, String, DateParserOptions): nullable DateTime

Try to parse a date with a given format and options.

 

class method TryParse(aDateTime: String; aFormat: String; aOptions: DateParserOptions): nullable DateTime

 

static DateTime? TryParse(String aDateTime, String aFormat, DateParserOptions aOptions)

 

// Toffee
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aOptions: DateParserOptions) -> DateTime
// ToffeeV2
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aOptions: DateParserOptions) -> DateTime?

 

static DateTime TryParse(String aDateTime, String aFormat, DateParserOptions aOptions)

 

Shared Function TryParse(aDateTime As String, aFormat As String, aOptions As DateParserOptions) As DateTime?

Parameters:

  • aDateTime:
  • aFormat:
  • aOptions:

TryParse (String, Locale, DateParserOptions): nullable DateTime

Try to parse a date with a given locale and options.

 

class method TryParse(aDateTime: String; aLocale: Locale; aOptions: DateParserOptions): nullable DateTime

 

static DateTime? TryParse(String aDateTime, Locale aLocale, DateParserOptions aOptions)

 

// Toffee
static func TryParse(_ aDateTime: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime
// ToffeeV2
static func TryParse(_ aDateTime: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime?

 

static DateTime TryParse(String aDateTime, Locale aLocale, DateParserOptions aOptions)

 

Shared Function TryParse(aDateTime As String, aLocale As Locale, aOptions As DateParserOptions) As DateTime?

Parameters:

  • aDateTime:
  • aLocale:
  • aOptions:

TryParse (String, DateParserOptions): nullable DateTime

Try to parse a date with the given options.

 

class method TryParse(aDateTime: String; aOptions: DateParserOptions): nullable DateTime

 

static DateTime? TryParse(String aDateTime, DateParserOptions aOptions)

 

// Toffee
static func TryParse(_ aDateTime: String, _ aOptions: DateParserOptions) -> DateTime
// ToffeeV2
static func TryParse(_ aDateTime: String, _ aOptions: DateParserOptions) -> DateTime?

 

static DateTime TryParse(String aDateTime, DateParserOptions aOptions)

 

Shared Function TryParse(aDateTime As String, aOptions As DateParserOptions) As DateTime?

Parameters:

  • aDateTime:
  • aOptions:

TryParseISO8601 (String): nullable DateTime

 

class method TryParseISO8601(aDateTime: String): nullable DateTime

 

static DateTime? TryParseISO8601(String aDateTime)

 

// Toffee
static func TryParseISO8601(_ aDateTime: String) -> DateTime
// ToffeeV2
static func TryParseISO8601(_ aDateTime: String) -> DateTime?

 

static DateTime TryParseISO8601(String aDateTime)

 

Shared Function TryParseISO8601(aDateTime As String) As DateTime?

Parameters:

  • aDateTime:

TryParseISO8601 (nullable JsonNode): nullable DateTime .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2

 

class method TryParseISO8601(aValue: nullable JsonNode): nullable DateTime

 

static DateTime? TryParseISO8601(JsonNode? aValue)

 

// Toffee
static func TryParseISO8601(_ aValue: JsonNode) -> DateTime
// ToffeeV2
static func TryParseISO8601(_ aValue: JsonNode?) -> DateTime?

 

Shared Function TryParseISO8601(aValue As JsonNode?) As DateTime?

Parameters:

  • aValue:

UtcNow

Current datetime in the UTC timezone.

 

class property UtcNow: not nullable DateTime read;

 

class DateTime! UtcNow { get; }

 

static var UtcNow: DateTime { get{} }

 

class DateTime UtcNow { __get; }

 

Shared ReadOnly Property UtcNow() As DateTime

Year

Returns the year.

 

property Year: Int32 read;

 

Int32 Year { get; }

 

var Year: Int32 { get{} }

 

Integer Year { __get; }

 

ReadOnly Property Year() As Int32

 

TicksTill1970

 

const TicksTill1970: Int64 = 621355968000000000;

 

const Int64 TicksTill1970 = 621355968000000000

 

static let TicksTill1970: Int64 = 621355968000000000

 

static final Int64 TicksTill1970 = 621355968000000000

 

Dim TicksTill1970 As Int64 = 621355968000000000

 

Date

Returns the date without time part.

 

property Date: DateTime read;

 

DateTime Date { get; }

 

var Date: DateTime { get{} }

 

DateTime Date { __get; }

 

ReadOnly Property Date() As DateTime

Day

Returns the day of the month (1..31)

 

property Day: Int32 read;

 

Int32 Day { get; }

 

var Day: Int32 { get{} }

 

Integer Day { __get; }

 

ReadOnly Property Day() As Int32

DayOfWeek

Returns the day of the week (1..7)

 

property DayOfWeek: Int32 read;

 

Int32 DayOfWeek { get; }

 

var DayOfWeek: Int32 { get{} }

 

Integer DayOfWeek { __get; }

 

ReadOnly Property DayOfWeek() As Int32

Hour

Returns the hour (0..23)

 

property Hour: Int32 read;

 

Int32 Hour { get; }

 

var Hour: Int32 { get{} }

 

Integer Hour { __get; }

 

ReadOnly Property Hour() As Int32

IsUTC

 

property IsUTC: Boolean read;

 

Boolean IsUTC { get; }

 

var IsUTC: Boolean { get{} }

 

Boolean IsUTC { __get; }

 

ReadOnly Property IsUTC() As Boolean

Millisecond .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2

 

property Millisecond: Int32 read;

 

Int32 Millisecond { get; }

 

var Millisecond: Int32 { get{} }

 

ReadOnly Property Millisecond() As Int32

Minute

Returns the minutes in this datetime.

 

property Minute: Int32 read;

 

Int32 Minute { get; }

 

var Minute: Int32 { get{} }

 

Integer Minute { __get; }

 

ReadOnly Property Minute() As Int32

Month

Returns the month in this datetime.

 

property Month: Int32 read;

 

Int32 Month { get; }

 

var Month: Int32 { get{} }

 

Integer Month { __get; }

 

ReadOnly Property Month() As Int32

OffsetToUTC

 

property OffsetToUTC: Int32 read;

 

Int32 OffsetToUTC { get; }

 

var OffsetToUTC: Int32 { get{} }

 

Integer OffsetToUTC { __get; }

 

ReadOnly Property OffsetToUTC() As Int32

Second

Returns the seconds in this datetime.

 

property Second: Int32 read;

 

Int32 Second { get; }

 

var Second: Int32 { get{} }

 

Integer Second { __get; }

 

ReadOnly Property Second() As Int32

Ticks

Returns the nr of ticks, there are 10 000 000 ticks in a second.

 

property Ticks: Int64 read;

 

Int64 Ticks { get; }

 

var Ticks: Int64 { get{} }

 

Int64 Ticks { __get; }

 

ReadOnly Property Ticks() As Int64

TimeSince

Returns the time passed since a given datetime compared to now.

 

property TimeSince: TimeSpan read;

 

TimeSpan TimeSince { get; }

 

var TimeSince: TimeSpan { get{} }

 

TimeSpan TimeSince { __get; }

 

ReadOnly Property TimeSince() As TimeSpan

Year

Returns the year.

 

property Year: Int32 read;

 

Int32 Year { get; }

 

var Year: Int32 { get{} }

 

Integer Year { __get; }

 

ReadOnly Property Year() As Int32

Today

Returns the current date without time part.

 

class property Today: not nullable DateTime read;

 

class DateTime! Today { get; }

 

static var Today: DateTime { get{} }

 

class DateTime Today { __get; }

 

Shared ReadOnly Property Today() As DateTime

UtcNow

Current datetime in the UTC timezone.

 

class property UtcNow: not nullable DateTime read;

 

class DateTime! UtcNow { get; }

 

static var UtcNow: DateTime { get{} }

 

class DateTime UtcNow { __get; }

 

Shared ReadOnly Property UtcNow() As DateTime

 

Compare

Compares two dates, and returns 0 if the same, -1 if less, 1 if more.

 

class method Compare(Value1: DateTime; Value2: DateTime): Int32

 

static Int32 Compare(DateTime Value1, DateTime Value2)

 

static func Compare(_ Value1: DateTime, _ Value2: DateTime) -> Int32

 

static Integer Compare(DateTime Value1, DateTime Value2)

 

Shared Function Compare(Value1 As DateTime, Value2 As DateTime) As Int32

Parameters:

  • Value1:
  • Value2:

FromOADate

Converts an OLE date to a DateTime

 

class method FromOADate(aOADate: Double): not nullable DateTime

 

static DateTime! FromOADate(Double aOADate)

 

static func FromOADate(_ aOADate: Double) -> DateTime

 

static DateTime FromOADate(Double aOADate)

 

Shared Function FromOADate(aOADate As Double) As DateTime

Parameters:

  • aOADate:

FromUnixDate

 

class method FromUnixDate(aUnixDate: Int32): not nullable DateTime

 

static DateTime! FromUnixDate(Int32 aUnixDate)

 

static func FromUnixDate(_ aUnixDate: Int32) -> DateTime

 

static DateTime FromUnixDate(Integer aUnixDate)

 

Shared Function FromUnixDate(aUnixDate As Int32) As DateTime

Parameters:

  • aUnixDate:

TimeSince (DateTime): TimeSpan

Returns the time passed since a given datetime compared to the current one.

 

class method TimeSince(aOtherDateTime: DateTime): TimeSpan

 

static TimeSpan TimeSince(DateTime aOtherDateTime)

 

static func TimeSince(_ aOtherDateTime: DateTime) -> TimeSpan

 

static TimeSpan TimeSince(DateTime aOtherDateTime)

 

Shared Function TimeSince(aOtherDateTime As DateTime) As TimeSpan

Parameters:

  • aOtherDateTime:

ToOADate (not nullable DateTime): Double

Convert a datetime to Ole date (double).

 

class method ToOADate(aDateTime: not nullable DateTime): Double

 

static Double ToOADate(DateTime! aDateTime)

 

static func ToOADate(_ aDateTime: DateTime) -> Double

 

static Double ToOADate(DateTime aDateTime)

 

Shared Function ToOADate(aDateTime As DateTime) As Double

Parameters:

  • aDateTime:

ToUnixDate (not nullable DateTime): Int32

 

class method ToUnixDate(aDateTime: not nullable DateTime): Int32

 

static Int32 ToUnixDate(DateTime! aDateTime)

 

static func ToUnixDate(_ aDateTime: DateTime) -> Int32

 

static Integer ToUnixDate(DateTime aDateTime)

 

Shared Function ToUnixDate(aDateTime As DateTime) As Int32

Parameters:

  • aDateTime:

TryParse (String, String, Locale, DateParserOptions): nullable DateTime

Try to parse a date with a given format, locale and options.

 

class method TryParse(aDateTime: String; aFormat: String; aLocale: Locale; aOptions: DateParserOptions): nullable DateTime

 

static DateTime? TryParse(String aDateTime, String aFormat, Locale aLocale, DateParserOptions aOptions)

 

// Toffee
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime
// ToffeeV2
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime?

 

static DateTime TryParse(String aDateTime, String aFormat, Locale aLocale, DateParserOptions aOptions)

 

Shared Function TryParse(aDateTime As String, aFormat As String, aLocale As Locale, aOptions As DateParserOptions) As DateTime?

Parameters:

  • aDateTime:
  • aFormat:
  • aLocale:
  • aOptions:

TryParse (String, String, DateParserOptions): nullable DateTime

Try to parse a date with a given format and options.

 

class method TryParse(aDateTime: String; aFormat: String; aOptions: DateParserOptions): nullable DateTime

 

static DateTime? TryParse(String aDateTime, String aFormat, DateParserOptions aOptions)

 

// Toffee
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aOptions: DateParserOptions) -> DateTime
// ToffeeV2
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aOptions: DateParserOptions) -> DateTime?

 

static DateTime TryParse(String aDateTime, String aFormat, DateParserOptions aOptions)

 

Shared Function TryParse(aDateTime As String, aFormat As String, aOptions As DateParserOptions) As DateTime?

Parameters:

  • aDateTime:
  • aFormat:
  • aOptions:

TryParse (String, Locale, DateParserOptions): nullable DateTime

Try to parse a date with a given locale and options.

 

class method TryParse(aDateTime: String; aLocale: Locale; aOptions: DateParserOptions): nullable DateTime

 

static DateTime? TryParse(String aDateTime, Locale aLocale, DateParserOptions aOptions)

 

// Toffee
static func TryParse(_ aDateTime: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime
// ToffeeV2
static func TryParse(_ aDateTime: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime?

 

static DateTime TryParse(String aDateTime, Locale aLocale, DateParserOptions aOptions)

 

Shared Function TryParse(aDateTime As String, aLocale As Locale, aOptions As DateParserOptions) As DateTime?

Parameters:

  • aDateTime:
  • aLocale:
  • aOptions:

TryParse (String, DateParserOptions): nullable DateTime

Try to parse a date with the given options.

 

class method TryParse(aDateTime: String; aOptions: DateParserOptions): nullable DateTime

 

static DateTime? TryParse(String aDateTime, DateParserOptions aOptions)

 

// Toffee
static func TryParse(_ aDateTime: String, _ aOptions: DateParserOptions) -> DateTime
// ToffeeV2
static func TryParse(_ aDateTime: String, _ aOptions: DateParserOptions) -> DateTime?

 

static DateTime TryParse(String aDateTime, DateParserOptions aOptions)

 

Shared Function TryParse(aDateTime As String, aOptions As DateParserOptions) As DateTime?

Parameters:

  • aDateTime:
  • aOptions:

TryParseISO8601 (String): nullable DateTime

 

class method TryParseISO8601(aDateTime: String): nullable DateTime

 

static DateTime? TryParseISO8601(String aDateTime)

 

// Toffee
static func TryParseISO8601(_ aDateTime: String) -> DateTime
// ToffeeV2
static func TryParseISO8601(_ aDateTime: String) -> DateTime?

 

static DateTime TryParseISO8601(String aDateTime)

 

Shared Function TryParseISO8601(aDateTime As String) As DateTime?

Parameters:

  • aDateTime:

TryParseISO8601 (nullable JsonNode): nullable DateTime .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2

 

class method TryParseISO8601(aValue: nullable JsonNode): nullable DateTime

 

static DateTime? TryParseISO8601(JsonNode? aValue)

 

// Toffee
static func TryParseISO8601(_ aValue: JsonNode) -> DateTime
// ToffeeV2
static func TryParseISO8601(_ aValue: JsonNode?) -> DateTime?

 

Shared Function TryParseISO8601(aValue As JsonNode?) As DateTime?

Parameters:

  • aValue:

 

constructor .NET, .NET Core 6.0, .NET Standard 2.0

 

constructor

 

DateTime()

 

init()

 

Sub New()

constructor (Int64)

Creates a new object with a given number of ticks.

 

constructor(aTicks: Int64)

 

DateTime(Int64 aTicks)

 

init(_ aTicks: Int64)

 

DateTime(Int64 aTicks)

 

Sub New(aTicks As Int64)

Parameters:

  • aTicks:

constructor (Int32, Int32, Int32)

Creates a new object with a given date.

 

constructor(aYear: Int32; aMonth: Int32; aDay: Int32)

 

DateTime(Int32 aYear, Int32 aMonth, Int32 aDay)

 

init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32)

 

DateTime(Integer aYear, Integer aMonth, Integer aDay)

 

Sub New(aYear As Int32, aMonth As Int32, aDay As Int32)

Parameters:

  • aYear:
  • aMonth:
  • aDay:

constructor (Int32, Int32, Int32, Int32, Int32)

Creates a new object with a given date.

 

constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32)

 

DateTime(Int32 aYear, Int32 aMonth, Int32 aDay, Int32 anHour, Int32 aMinute)

 

init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32, _ anHour: Int32, _ aMinute: Int32)

 

DateTime(Integer aYear, Integer aMonth, Integer aDay, Integer anHour, Integer aMinute)

 

Sub New(aYear As Int32, aMonth As Int32, aDay As Int32, anHour As Int32, aMinute As Int32)

Parameters:

  • aYear:
  • aMonth:
  • aDay:
  • anHour:
  • aMinute:

constructor (Int32, Int32, Int32, Int32, Int32, Int32)

Creates a new object with a given date.

 

constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32; aSecond: Int32)

 

DateTime(Int32 aYear, Int32 aMonth, Int32 aDay, Int32 anHour, Int32 aMinute, Int32 aSecond)

 

init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32, _ anHour: Int32, _ aMinute: Int32, _ aSecond: Int32)

 

DateTime(Integer aYear, Integer aMonth, Integer aDay, Integer anHour, Integer aMinute, Integer aSecond)

 

Sub New(aYear As Int32, aMonth As Int32, aDay As Int32, anHour As Int32, aMinute As Int32, aSecond As Int32)

Parameters:

  • aYear:
  • aMonth:
  • aDay:
  • anHour:
  • aMinute:
  • aSecond:

constructor (Int32, Int32, Int32, Int32, Int32, Int32, Int32)

 

constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32; aSecond: Int32; aMSec: Int32)

 

DateTime(Int32 aYear, Int32 aMonth, Int32 aDay, Int32 anHour, Int32 aMinute, Int32 aSecond, Int32 aMSec)

 

init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32, _ anHour: Int32, _ aMinute: Int32, _ aSecond: Int32, _ aMSec: Int32)

 

DateTime(Integer aYear, Integer aMonth, Integer aDay, Integer anHour, Integer aMinute, Integer aSecond, Integer aMSec)

 

Sub New(aYear As Int32, aMonth As Int32, aDay As Int32, anHour As Int32, aMinute As Int32, aSecond As Int32, aMSec As Int32)

Parameters:

  • aYear:
  • aMonth:
  • aDay:
  • anHour:
  • aMinute:
  • aSecond:
  • aMSec:

Add

Add a timespan to a date, and returning the new date.

 

method Add(Value: TimeSpan): not nullable DateTime

 

DateTime! Add(TimeSpan Value)

 

func Add(_ Value: TimeSpan) -> DateTime

 

DateTime Add(TimeSpan Value)

 

Function Add(Value As TimeSpan) As DateTime

Parameters:

  • Value:

AddDays

Adds a nr of days and returns a new datetime.

 

method AddDays(Value: Int32): not nullable DateTime

 

DateTime! AddDays(Int32 Value)

 

func AddDays(_ Value: Int32) -> DateTime

 

DateTime AddDays(Integer Value)

 

Function AddDays(Value As Int32) As DateTime

Parameters:

  • Value:

AddHours

Adds a nr of hours and returns a new datetime.

 

method AddHours(Value: Int32): not nullable DateTime

 

DateTime! AddHours(Int32 Value)

 

func AddHours(_ Value: Int32) -> DateTime

 

DateTime AddHours(Integer Value)

 

Function AddHours(Value As Int32) As DateTime

Parameters:

  • Value:

AddMilliSeconds

Adds a nr of msec and returns a new datetime.

 

method AddMilliSeconds(Value: Int32): not nullable DateTime

 

DateTime! AddMilliSeconds(Int32 Value)

 

func AddMilliSeconds(_ Value: Int32) -> DateTime

 

DateTime AddMilliSeconds(Integer Value)

 

Function AddMilliSeconds(Value As Int32) As DateTime

Parameters:

  • Value:

AddMinutes

Adds a nr of minutes and returns a new datetime.

 

method AddMinutes(Value: Int32): not nullable DateTime

 

DateTime! AddMinutes(Int32 Value)

 

func AddMinutes(_ Value: Int32) -> DateTime

 

DateTime AddMinutes(Integer Value)

 

Function AddMinutes(Value As Int32) As DateTime

Parameters:

  • Value:

AddMonths

Adds a nr of months and returns a new datetime.

 

method AddMonths(Value: Int32): not nullable DateTime

 

DateTime! AddMonths(Int32 Value)

 

func AddMonths(_ Value: Int32) -> DateTime

 

DateTime AddMonths(Integer Value)

 

Function AddMonths(Value As Int32) As DateTime

Parameters:

  • Value:

AddSeconds

Adds a nr of seconds and returns a new datetime.

 

method AddSeconds(Value: Int32): not nullable DateTime

 

DateTime! AddSeconds(Int32 Value)

 

func AddSeconds(_ Value: Int32) -> DateTime

 

DateTime AddSeconds(Integer Value)

 

Function AddSeconds(Value As Int32) As DateTime

Parameters:

  • Value:

AddYears

Adds a nr of years and returns a new datetime.

 

method AddYears(Value: Int32): not nullable DateTime

 

DateTime! AddYears(Int32 Value)

 

func AddYears(_ Value: Int32) -> DateTime

 

DateTime AddYears(Integer Value)

 

Function AddYears(Value As Int32) As DateTime

Parameters:

  • Value:

CompareTo (Object): Int32 Island

 

method CompareTo(other: Object): Int32

 

Int32 CompareTo(Object other)

 

func CompareTo(_ other: Object) -> Int32

 

Function CompareTo(other As Object) As Int32

Parameters:

  • other:

CompareTo (DateTime): Int32

Compares this date, and returns 0 if the same, -1 if less, 1 if more.

 

method CompareTo(Value: DateTime): Int32

 

Int32 CompareTo(DateTime Value)

 

func CompareTo(_ Value: DateTime) -> Int32

 

Integer CompareTo(DateTime Value)

 

Function CompareTo(Value As DateTime) As Int32

Parameters:

  • Value:

ToISO8601String

 

method ToISO8601String(aFormat: ISO8601Format; aTimeZone: TimeZone): not nullable String

 

String! ToISO8601String(ISO8601Format aFormat, TimeZone aTimeZone)

 

func ToISO8601String(_ aFormat: ISO8601Format, _ aTimeZone: TimeZone) -> String

 

String ToISO8601String(ISO8601Format aFormat, TimeZone aTimeZone)

 

Function ToISO8601String(aFormat As ISO8601Format, aTimeZone As TimeZone) As String

Parameters:

  • aFormat:
  • aTimeZone:

ToLongPrettyDateString

Convert a date to string in a given timezone, long format.

 

method ToLongPrettyDateString(aTimeZone: TimeZone): not nullable String

 

String! ToLongPrettyDateString(TimeZone aTimeZone)

 

func ToLongPrettyDateString(_ aTimeZone: TimeZone) -> String

 

String ToLongPrettyDateString(TimeZone aTimeZone)

 

Function ToLongPrettyDateString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToOADate .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2

 

method ToOADate: Double

 

Double ToOADate()

 

func ToOADate() -> Double

 

Function ToOADate() As Double

ToShortDateString

Convert a date to string in a given timezone, short format.

 

method ToShortDateString(aTimeZone: TimeZone): not nullable String

 

String! ToShortDateString(TimeZone aTimeZone)

 

func ToShortDateString(_ aTimeZone: TimeZone) -> String

 

String ToShortDateString(TimeZone aTimeZone)

 

Function ToShortDateString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToShortPrettyDateAndTimeString

Convert a date and time to string in a given timezone, long format.

 

method ToShortPrettyDateAndTimeString(aTimeZone: TimeZone): not nullable String

 

String! ToShortPrettyDateAndTimeString(TimeZone aTimeZone)

 

func ToShortPrettyDateAndTimeString(_ aTimeZone: TimeZone) -> String

 

String ToShortPrettyDateAndTimeString(TimeZone aTimeZone)

 

Function ToShortPrettyDateAndTimeString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToShortPrettyDateString

Convert a date to string in a given timezone, short format.

 

method ToShortPrettyDateString(aTimeZone: TimeZone): not nullable String

 

String! ToShortPrettyDateString(TimeZone aTimeZone)

 

func ToShortPrettyDateString(_ aTimeZone: TimeZone) -> String

 

String ToShortPrettyDateString(TimeZone aTimeZone)

 

Function ToShortPrettyDateString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToShortTimeString

Convert a time to string in a given timezone, short format.

 

method ToShortTimeString(aTimeZone: TimeZone): not nullable String

 

String! ToShortTimeString(TimeZone aTimeZone)

 

func ToShortTimeString(_ aTimeZone: TimeZone) -> String

 

String ToShortTimeString(TimeZone aTimeZone)

 

Function ToShortTimeString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToString  override virtual .NET, .NET Core 6.0, .NET Standard 2.0, Island

Convert this datetime to stirng.

 

method ToString: PlatformString

 

PlatformString ToString()

 

func ToString() -> PlatformString

 

Function ToString() As PlatformString

ToString (TimeZone): not nullable String

Convert this datetime to stirng with a given timezone.

 

method ToString(aTimeZone: TimeZone): not nullable String

 

String! ToString(TimeZone aTimeZone)

 

func ToString(_ aTimeZone: TimeZone) -> String

 

String ToString(TimeZone aTimeZone)

 

Function ToString(aTimeZone As TimeZone) As String

Parameters:

  • aTimeZone:

ToString (String, TimeZone): not nullable String

Convert this datetime to stirng with a given format and timezone.

 

method ToString(Format: String; aTimeZone: TimeZone): not nullable String

 

String! ToString(String Format, TimeZone aTimeZone)

 

func ToString(_ Format: String, _ aTimeZone: TimeZone) -> String

 

String ToString(String Format, TimeZone aTimeZone)

 

Function ToString(Format As String, aTimeZone As TimeZone) As String

Parameters:

  • Format:
  • aTimeZone:

ToString (String, String, TimeZone): not nullable String

Convert this datetime to stirng with a given format, culture and timezone.

 

method ToString(Format: String; Culture: String; aTimeZone: TimeZone): not nullable String

 

String! ToString(String Format, String Culture, TimeZone aTimeZone)

 

func ToString(_ Format: String, _ Culture: String, _ aTimeZone: TimeZone) -> String

 

String ToString(String Format, String Culture, TimeZone aTimeZone)

 

Function ToString(Format As String, Culture As String, aTimeZone As TimeZone) As String

Parameters:

  • Format:
  • Culture:
  • aTimeZone:

ToUnixDate .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2

 

method ToUnixDate: Int32

 

Int32 ToUnixDate()

 

func ToUnixDate() -> Int32

 

Function ToUnixDate() As Int32