lang • format


String = Format$ ( Expression [ , Format ] ) String = Format ( Expression [ , Format ] )

Converts the Expression to a String by using a format that depends on the type of the Expression .

This function can format dates, times, numbers, and currencies.

Format can be:

See Predefined Constants for a list of predefined formats, and User-defined formats for the syntax used by the Format string.

This function uses localization information.


Dim dDate As Date = Now
Print Format(dDate, "dddd dd/mm/yyyy hh:nn:ss")
Friday 15/02/2019 00:18:14

See also