DWS Date & Time Library

Top  Previous  Next  Contents  Index 

The following standard date and time functions are supported in DWS scripts:

 

function Date: DateTime;

returns the current date

 

function DateTimeToStr(<DateTime>): String;

converts <DateTime> to a string using the current locale

 

function DateToStr(<DateTime>): String;

converts <DateTime> to a date string using the current locale

 

function DayOfWeek(<DateTime>): Integer;

returns an integer corresponding to the day-of-the-week of the passed date

 

procedure DecodeDate(<DateTime>, var <Integer year>, var <Integer month>, var <Integer day>);

fills <year>, <month>, and <day> from <DateTime>

 

procedure DecodeTime(<DateTime>, var <Integer hour>, var <Integer minute>, var <Integer second>, var <Integer millisecond>);

fills <hour>, <minute>, <second>, and <millisecond> from <DateTime>

 

function EncodeDate(<Integer year>, <Integer month>, <Integer day>): DateTime;

returns a DateTime from <year>, <month>, and <day>

 

function EncodeTime(<Integer hour>, <Integer minute>, <Integer second>, <Integer millisecond>): DateTime;

returns a DateTime from <hour>, <minute>, <second>, and <millisecond>

 

function FormatDateTime(<String format>, <DateTime>): String;

converts the passed DateTime to a string using format

 

function IncMonth(<DateTime>, <Integer months>): DateTime

returns <DateTime> shifted by <Integer months>

 

function IsLeapYear(<Integer year>): Boolean;

returns True if <Integer year> is a leap year, else False

 

function Now: DateTime;

returns the current date and time

 

function StrToDate(<String>): DateTime;

converts date <String> to a DateTime

 

function StrToDateTime(<String>): DateTime;

converts <String> to a DateTime

 

function StrToTime(<String>): DateTime;

converts time <String> to a DateTime

 

function Time: DateTime;

returns the current time

 

function TimeToStr(<DateTime>): String;

converts <DateTime> to a time string using the current locale