Date and Time Functions

FreeBASIC

Date and Time Functions
 
Procedures that work with dates and time.

Description

These procedures provide ways to deal with date and time intervals in a consistent way. Additional procedures are provided to set and get the current system date and time, and to retrieve a time stamp for sensitive timing algorithms.

VisualBasic compatible procedures
Procedures for working with so-called date serials, similar to those used in Visual Basic(r).
Date and time procedures
Procedures for working with the system date and time.

VisualBasic compatible procedures
Now
Gets a date serial of the current date and time.

Creating Date serials
DateSerial
Gets the date serial representation of a date.
TimeSerial
Gets the date serial representation of a time.
DateValue
Gets the date serial representation of a date expressed as a String.
TimeValue
Gets the date serial representation of a time expressed as a String.

Extracting information from Date serials
Second
Gets the seconds of the hour from a date serial.
Minute
Gets the minutes of the hour from a date serial.
Hour
Gets the hour of the day from a date serial.
Day
Gets the day of the month from a date serial.
Weekday
Gets the day of the week from a date serial.
Month
Gets the month of the year from a date serial.
Year
Gets the year from a date serial.
DatePart
Gets a time interval from a date serial.

Extracting information from Date serials
DateAdd
Gets the result of a time interval added to a date serial.
DateDiff
Gets a time interval between two date serials.

Miscellaneous
IsDate
Tests if a String can be converted to a date serial.
MonthName
Gets the month name of its integer representation.
WeekdayName
Gets the weekday name of its integer representation.
Date and time procedures
Date
Gets the String representation of the current system date.
Time
Gets the String representation of the current system time.
SetDate
Sets the current system date.
SetTime
Sets the current system time.
Timer
Gets a counter expressed in seconds.