Xbasic

Predefined Date Formats

Description

The following formats can be used with the DTOC() function.

Predefined Date Formats

Format Code
Meaning
1-

12-31-2015

2-

21-12-2015

1/

12/31/2015

2/

31/12/2015

3

31 December 2015

4

December 31, 2015

8

December 31st, 2015

5-

12-15

6-

12-31-15

7-

31-12-15

5/

12/15

6/

12/31/15

7/

31/12/15

9-

31-Dec-15

10

31 Dec 2015

11-

15-12-31

12-

2015-12-31

11/

15/12/31

12/

2015/12/31

11.

15.12.31

12.

2015.12.31

3C

31 DECEMBER 2015

4C

DECEMBER 31, 2015

8C

DECEMBER 31ST, 2015

9C-

31-DEC-15

10C

31 DEC 2015

Example

dim dd as D
dd = date()
? dtoc(dd,"1-")
= "01-06-2004"
? dtoc(dd,"4")
= "January 6, 2004"

See Also