DateTime-Functions

LA.Docs
March 1st, 2016

List of DateTime-Functions


CurrentDate(): datetime

Returns the current system date.

CurrentTime(): datetime

Returns the current system time.

DateFormat(Fmt: string; Value: datetime): string

Formats given datetime value to a string.

Example Basic:
println(DateFormat("yyyy/mm/dd hh:nn:ss.zzz", Now))
println(DateFormat("ddd dd, mmm yyyy", Now))
println(DateFormat("dddd dd, mmmm yyyy", Now))
readln

DateOf(Value: datetime): datetime

Strips the time portion from a datetime value.

DateTimeToJulianDate(const Value: datetime): double

Converts given datetime to a julian date (double) value.

DateTimeToStr(const Value: datetime): string

Converts given datetime value to a string value.

DateTimeToUnix(const Value: datetime): int64

Converts given datetime to a unix date (int64) value.

DateToStr(const Value: datetime): string

Strips the time portion of given datetime value and converts it to a string value.

DayFriday(): int

Returns the number for Friday.

DayMonday(): int

Returns the number for Monday.

DayOf(Value: datetime): int

Returns the day (1-31) of given datetime value.

DayOfTheMonth(Value: datetime): int

Returns the day (1-31) of given datetime value.

DayOfTheWeek(Value: datetime): int

Returns the week day (1-7) of given datetime value.

DayOfTheYear(Value: datetime): int

Returns the year day (1-365) of given datetime value.

DaySaturday(): int

Returns the number for Saturday.

DaysBetween(const ANow, AThen: datetime): int

Returns the number of days in between ANow and AThen datetime values.

DaysInMonth(Value: datetime): int

Returns the number of days is a month of given datetime value.

DaysInYear(Value: datetime): int

Returns the number of days is a year of given datetime value.

DaysPerWeek(): int

Returns the number of days is a week of given datetime value.

DaySunday(): int

Returns the number for Sunday.

DayThursday(): int

Returns the number for Thursday.

DayTuesday(): int

Returns the number for Tuesday.

DayWednesday(): int

Returns the number for Wednesday.

EncodeDateTime(aYear, aMonth, aDay, aHour, aMin, aSec, aMilSec: int): datetime

Creates and returns a datetime value from given year, month, day, hour, minute, second, millisecond values.

EndOfTheDay(Value: datetime): datetime

Return the end of the day of given datetime.

EndOfTheMonth(Value: datetime): datetime

Returns the end of the month of given datetime.

EndOfTheWeek(Value: datetime): datetime

Returns the end of the week of given datetime.

EndOfTheYear(Value: datetime): datetime

Returns the end of the year of given datetime.

HourOf(Value: datetime): int

Returns the hour (1-24) of given datetime.

HourOfTheDay(Value: datetime): int

Returns the hour (1-24) of given datetime.

HourOfTheMonth(Value: datetime): int

Returns the hour (1-744) the month of given datetime.

HourOfTheWeek(Value: datetime): int

Returns the hour (1-168) the week of given datetime.

HourOfTheYear(Value: datetime): int

Returns the hour (1-8760) the year of given datetime.

HoursBetween(const ANow, AThen: datetime): int

Returns the number of hours between ANow and AThen value.

HoursPerDay(): int

Returns the number of hours per day.

IncDay(Value: datetime; IncNum: int): datetime

Increased given datetime by given number of days.

IncHour(Value: datetime; IncNum: int): datetime

Increased given datetime by given number of hours.

IncMilliSecond(Value: datetime; IncNum: int): datetime

Increased given datetime by given number of milliseconds.

IncMinute(Value: datetime; IncNum: int): datetime

Increased given datetime by given number of minutes.

IncMonth(Value: datetime; IncNum: int): datetime

Increased given datetime by given number of months.

IncSecond(Value: datetime; IncNum: int): datetime

Increased given datetime by given number of seconds.

IncWeek(Value: datetime; IncNum: int): datetime

Increased given datetime by given number of weeks.

IncYear(Value: datetime; IncNum: int): datetime

Increased given datetime by given number of years.

IsInLeapYear(Value: datetime): bool

Returns true if given datetime value is a leap year.

IsPM(Value: datetime): bool

Returns true if given datetime value is in the afternoon.

IsSameDay(Value, Basis: datetime): bool

Returns true if given datetime values are the same day.

IsToday(Value: datetime): bool

Returns true if given datetime value is Today.

IsValidDate(aYear, aMonth, aDay: int): bool

Returns true if given year, month, and day values represent a valid date.

IsValidTime(aHour, aMinute, aSec, aMilSec: int): bool

Returns true if given hour, minute, second, and millisecond values represent a valid time.

JulianDateToDateTime(const Value: double): datetime

Convert a Julian Date (double) value to a datetime value.

MilliSecondOf(Value: datetime): int

Returns the number of milliseconds of given datetime.

MilliSecondOfTheDay(Value: datetime): int

Returns the number of milliseconds of the day.

MilliSecondOfTheHour(Value: datetime): int

Returns the number of milliseconds of the hour.

MilliSecondOfTheMinute(Value: datetime): int

Returns the number of milliseconds of the minute.

MilliSecondOfTheMonth(Value: datetime): int

Returns the number of milliseconds of the month.

MilliSecondOfTheSecond(Value: datetime): int

Returns the number of milliseconds of the second.

MilliSecondOfTheWeek(Value: datetime): int

Returns the number of milliseconds of the week.

MilliSecondOfTheYear(Value: datetime): int

Returns the number of milliseconds of the year.

MilliSecondsBetween(const ANow, AThen: datetime): int

Returns the number of milliseconds between ANow and AThen datetime values.

MinsPerDay(): int

Returns the number of minutes per day.

MinsPerHour(): int

Returns the number of minutes per hour.

MinuteOf(Value: datetime): int

Returns the number of minutes (1-60) of given datetime value.

MinuteOfTheDay(Value: datetime): int

Returns the number of minutes (1-1440) of given datetime value.

MinuteOfTheHour(Value: datetime): int

Returns the number of minutes (1-60) of given datetime value.

MinuteOfTheMonth(Value: datetime): int

Returns the number of minutes (1-43200) of given datetime value.

MinuteOfTheWeek(Value: datetime): int

Returns the number of minutes (1-10080) of given datetime value.

MinuteOfTheYear(Value: datetime): int

Returns the number of minutes (1-525600) of given datetime value.

MinutesBetween(const ANow, AThen: datetime): int

Returns the number of minutes between ANow and AThen datetime values.

MonthOf(Value: datetime): int

Returns the number of month (1-12) of given datetime value.

MonthOfTheYear(Value: datetime): int

Returns the number of month (1-12) of given datetime value.

MonthsBetween(const ANow, AThen: datetime): int

Returns the number of month between ANow and AThen datetime values.

MonthsPerYear(): int

Returns the number of months per year.

MSecsPerDay(): int

Returns the number of milliseconds per day.

MSecsPerSec(): int

Returns the number of milliseconds per second.

Now(): datetime

Returns the current date and time.

OneHour(): int

Returns 1.

OneMillisecond(): int

Returns 1.

OneMinute(): int

Returns 1.

OneSecond(): int

Returns 1.

SameDate(const A, B: datetime): bool

Returns true when A and B datetime values are the same date.

SameDateTime(const A, B: datetime): bool

Returns true when A and B datetime values are the same date and time.

SameTime(const A, B: datetime): bool

Returns true when A and B datetime values are the same time.

SecondOf(Value: datetime): int

Returns the number of second (1-60) of given datetime value.

SecondOfTheDay(Value: datetime): int

Returns the number of second (1-86400) of given datetime value.

SecondOfTheHour(Value: datetime): int

Returns the number of second (1-3600) of given datetime value.

SecondOfTheMinute(Value: datetime): int

Returns the number of second (1-60) of given datetime value.

SecondOfTheMonth(Value: datetime): int

Returns the number of second (1-2678400) of given datetime value.

SecondOfTheWeek(Value: datetime): int

Returns the number of second (1-604800) of given datetime value.

SecondOfTheYear(Value: datetime): int

Returns the number of second (1-31536000) of given datetime value.

SecondsBetween(const ANow, AThen: datetime): int

Returns the number of seconds between ANow and AThen datetime values.

SecsPerDay(): int

Returns the number of seconds per day.

SecsPerMin(): int

Returns the number of seconds per minute.

StartOfTheDay(Value: datetime): datetime

Returns the start of the day of given datetime value.

StartOfTheMonth(Value: datetime): datetime

Returns the start of the month of given datetime value.

StartOfTheWeek(Value: datetime): datetime

Returns the start of the week of given datetime value.

StartOfTheYear(Value: datetime): datetime

Returns the start of the year of given datetime value.

StrToDate(const Value: string): datetime

Conver a string value to a date.

StrToDateTime(const Value: string): datetime

Conver a string value to a datetime.

StrToTime(const Value: string): datetime

Conver a string value to a time.

TimeOf(Value: datetime): datetime

Returns the time portion of given datetime value.

TimeStamp(): datetime

Returns the current date and time.

TimeToStr(const Value: datetime): string

Convert time to a string.

Today(): datetime

Returns todays date.

Tomorrow(): datetime

Returns tomorrows date.

UnixToDateTime(const Value: int64): datetime

Convert a Unix datetime (int64) to datetime.

WeekOf(Value: datetime): int

Returns the week number (1-54) of given datetime.

WeekOfTheMonth(Value: datetime): int

Returns the week number (1-5) of given datetime.

WeekOfTheYear(Value: datetime): int

Returns the week number (1-54) of given datetime.

WeeksBetween(const ANow, AThen: datetime): int

Returns the number of weeks between ANow and AThen datetime values.

WeeksInYear(Value: datetime): int

Returns the number of weeks in a year.

WeeksPerFortnight(): int

Returns the number of weeks per Fortnight.

YearOf(Value: datetime): int

Returns the year number of given datetime.

YearsBetween(const ANow, AThen: datetime): int

Returns the number if years between ANow and AThen datetime values.

YearsPerCentury(): int

Returns the number of years per century.

YearsPerDecade(): int

Returns the number of years per decade.

YearsPerMillennium(): int

Returns the number of years per millenium.

Yesterday(): datetime

Return the date of yesterday.