TurboDB Engine Dokumentation
Date and Time Operators and Functions

Top 


All numeric operators can equally be used for date and time values. All date and datetime values are treated like the number of days since 1/1/0000. Therefore date values are always integer numbers while datetime values have decimal digits to represent a part of a day. Time values stand for the number of minutes since midnight. This way Date2 - Date1 results in the number of days from Date1 to Date2. Time2 - Time1 returns the number of minutes from Time1 to Time2.

Beyond the numeric operators and functions there are also special date and time functions:
DateStr(Date: Double): StringReturns the string representation of a date.     
DateTimeStr(Date: Double): StringReturns the string representation of a datetime.     
DateTimeVal(Str: String): DoubleConverts a string to a datetime value.     
Day(Date: Double): DoubleExtracts the day out of a date.     
DayOfWeek(Date: Double): StringReturns the week-day of the date as string.     
Month(Date: Double): DoubleExtracts the month out of a date.     
Now: DoubleReturns the current time.     
TimeStr(Time: Double): StringReturns the string representation of a time value.     
TimeToDateTime(Time: Double): DoubleReturns the datetime representation (fractional day count) for a time value (number of minutes since midnight).     
Today: DoubleReturns the current date.     
Val(Str: String): DoubleReturns the numeric value from a date/time string.     
Week(Date: Double): DoubleReturns the Double of the week in the current year.     
Year(Date: Double): DoubleExtracts the year out of a date.