API Documentation > CorelDRAW > 2025-v26 > CorelScriptTools > ICorelScriptTools
CorelScriptTools.FormatTime method
Format Time
Syntax:
Function FormatTime(ByVal Time As Date, ByVal Format As String) As String
Parameters:
Name Type Description
Time
Date
Format
String
Remarks:
You can insert spaces and punctuation between time elements within the formatting string. See the example that follows.
Examples:
In the following code example, the first line declares the date variable TodayDate. This variable is then assigned the current date and time with the GetCurrDate function. The StringTime variable is then assigned the current time using h:mm pm formatting.
DIM TimeNow AS DATE TimeNow = GETCURRDATE() StringTime = FORMATTIME (TimeNow, "HH:mm:ss tt") MESSAGE StringTime