<cDateTime>.ToString

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Core Language > BuiltIn Functions > Date and Time > cDateTime > cDateTime_Methods >

<cDateTime>.ToString

 

Description

 

Handy function returning current date and time in a string form.

 

Syntax

 

<cDateTime>.ToString[(lFormat)]

 

Returns

 

String in a form YYYY/MM/DD HH:mm:ss.SSS - always, not dependent on system locale.

 
Otherwise see lFormat optional parameter for additional return string formats

 

Parameters

 

Name

Type

Optional

Meaning

lFormat

Numeric

Yes

Numeric value indicating return string formats.
 

Possible other formatting types:

0YYYY/MM/DD HH:mm:ss.SSS

 

10YYYY-MM-DD HH:MM:SS
11YYYYMMDDHHmmssSS

 

 

Remarks

 

Does not depend on system locale.

 

Restrictions

 

See also

 

Examples

 

' Create an object with current date and time

Dim myDateTime As New cDateTime

 

' Displays the current time and date

MsgBox 0, "myDateTime is:" + $CRLF + myDateTime.toString