Date and time methods
Business Central provides many date and time methods. In the following sections, we will cover several of those that are more commonly used, especially in the context of accounting date-sensitive activity:
Today
,Time
, andCurrentDateTime
methodsWorkDate
methodDate2DMY
,Date2DWY
,DMY2Date
,DWY2Date
, andCalcDate
methods
Today, Time, and CurrentDateTime methods
Today
retrieves the current system date. Time
retrieves the current system time, as set in the operating system. Both Today
and Time
are influenced by the time zone client setting.
CurrentDateTime
retrieves the current date and time in the DateTime
format, which is stored in UTC international time (formerly referenced as Greenwich Mean Time (GMT)) and then displayed in local time. The syntax for each of these is as follows:
DateField := Today; TimeField := Time; DateTimeField := CurrentDateTime;
These are often used for date- and time-stamping transactions or for filling...