Format date [ ] as [ ]

Command

FORMAT

Image
Group Functions
Section Dates

Description

Changes the format of a date

Parameter 1

The date control, variable or data field to be formatted

Parameter 2

The formatting string as detailed in Date Format options

 

Date Format options

Code Description

d

Represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero

dd

Represents the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero

ddd

Represents the abbreviated name of the day of the week (Mon, Tues, Wed etc)

dddd

Represents the full name of the day of the week (Monday, Tuesday etc)

h

12-hour clock hour (e.g. 7)

hh

12-hour clock, with a leading 0 (e.g. 07)

H

24-hour clock hour (e.g. 19)

HH

24-hour clock hour, with a leading 0 (e.g. 19)

m

Minutes

mm

Minutes with a leading zero

M

Month number

MM

Month number with leading zero

MMM

Abbreviated Month Name (e.g. Dec)

MMMM

Full month name (e.g. December)

s

Seconds

ss

Seconds with leading zero

t

Abbreviated AM / PM (e.g. A or P)

tt

AM / PM (e.g. AM or PM

y

Year, no leading zero (e.g. 2001 would be 1)

yy

Year, leadin zero (e.g. 2001 would be 01)

yyy

Year with minimum of three digits, (e.g. 2001 would be 2001)

yyyy

Year, (e.g. 2001 would be 2001)

K

Represents the time zone information of a date and time value (e.g. +05:00)

z

With DateTime values, represents the signed offset of the local operating system's time zone from Coordinated Universal Time (UTC), measured in hours. (e.g. +6)

zz

As z but with leadin zero (e.g. +06)

zzz

With DateTime values, represents the signed offset of the local operating system's time zone from UTC, measured in hours and minutes. (e.g. +06:00)

f

Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value.

ff

Represents the two most significant digits of the seconds fraction; that is, it represents the hundredths of a second in a date and time value.

fff

Represents the three most significant digits of the seconds fraction; that is, it represents the milliseconds in a date and time value.

ffff

Represents the four most significant digits of the seconds fraction; that is, it represents the ten thousandths of a second in a date and time value. While it is possible to display the ten thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

fffff

Represents the five most significant digits of the seconds fraction; that is, it represents the hundred thousandths of a second in a date and time value. While it is possible to display the hundred thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

ffffff

Represents the six most significant digits of the seconds fraction; that is, it represents the millionths of a second in a date and time value. While it is possible to display the millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

fffffff

Represents the seven most significant digits of the seconds fraction; that is, it represents the ten millionths of a second in a date and time value. While it is possible to display the ten millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

F

Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value. Nothing is displayed if the digit is zero.