Custom date formats (Production Mapping)

With field configurations, you can choose to set up a custom date format to display the date value in a field that is a string or date type. The Custom Format option on the context menu of the Field Configuration or Edit Shared Fields dialog box allows you to define a format for the date that is composed of several characters. There are also single characters that provide preformatted date and time information.

Single-character formats

The table below shows single characters that can be used to provide date formats when field configurations are used.

Character

Description

Example

d

Displays the date as month/day/year.

7/19/2011

D

Displays the long version of the date including the day of the week.

Thursday, July 21, 2011

f

Displays the long version of the date, including the day of the week, and the time.

Thursday, July 21, 2011 8:30 AM

F

Displays the long version of the date and the time with seconds.

Thursday, July 21, 2011 8:30:36 AM

g

Displays the date as month/day/year and the time as hours:minutes with the AM or PM designator.

7/21/2011 8:30 AM

G

Displays the date as month/day/year and the time as hours:minutes:seconds with the AM or PM designator.

7/21/2011 8:30:36 AM

m or M

Displays the month and day without the year.

July 19

r or R

Displays the long version of the date as day of the week, day, month, year with the day and month abbreviated and the time in 24-hour GMT format.

Thu, 21 Jul 2011 08:30:36 GMT

s

Displays the date as year-month-day and the time in 24-hour format.

2011-07-21T08:30:36

t

Displays the time as hours:minutes with the AM or PM designator.

8:30 AM

T

Displays the time as hours:minutes:seconds with the AM or PM designator.

8:30:36 AM

u

Displays the date as year-month-day and time in hours:minute:seconds format.

2011-07-21 08:30:36Z

U

Displays the date as day of the week, month, day, year and the time in hours:minutes:seconds with the AM or PM designator; the time displayed is universal and not the local time.

Thursday, July 21, 2011 3:30:36 PM

y or Y

Displays the month and year.

July, 2011

Single characters that display date and time formats

Characters that can be used as parts of date and time formats

The table below contains characters that can be used in conjunction with each other to create a custom date and time format. Some of these characters are the same as the single-character formats but provide different information when combined with other parts of the date and time format.

Character

Description

Example

d

Displays the day without leading zeroes in a date string

x/9/xxxx

dd

Displays the day with leading zeroes in a date string

x/09/xxxx

ddd

Displays the three-letter abbreviation of the day of the week in a date string

注意注意:

When the field that you are storing the date value in has the field type of text, this character is not automatically validated using the Feature Manager. It is recommended that you create validation rules for the field using the Regular Expression or Execute SQL checks.

Thu

dddd

Displays the full name of the day of the week in the date string

注意注意:

When the field that you are storing the date value in has the field type of text, this character is not automatically validated using the Feature Manager. It is recommended that you create validation rules for the field using the Regular Expression or Execute SQL checks.

Thursday

g or gg

Displays the full name of the current era in a date string

x/x/xxxx A.D.

h

Displays the hour without leading zeroes, ranging from 1 to 12, in a time string

8:xx

hh

Displays the hour with leading zeroes, ranging from 01 to 12, in a time string

08:xx

H

Displays the hour without leading zeroes, ranging from 1 to 23, in a time string

08:xx

HH

Displays the hour with leading zeroes, ranging from 01 to 23, in a time string

08:xx or 20:xx

m

Displays the minute without leading zeroes, ranging from 1 to 59, in a time string

x:9

mm

Displays the minute with leading zeroes, ranging from 01 to 59, in a time string

x:09

M

Displays the month number without leading zeroes, ranging from 1 to 12, in a date string

7/xx/xxxx

MM

Displays the month number with leading zeroes, ranging from 01 to 12, in a date string

07/xx/xxxx

MMM

Displays the abbreviation for the month name in a date string

注意注意:

When the field that you are storing the date value in has the field type of text, this character is not automatically validated using the Feature Manager. It is recommended that you create validation rules for the field using the Regular Expression or Execute SQL checks.

Jul x, xxxx

MMMM

Displays the full month name in a date string

注意注意:

When the field that you are storing the date value in has the field type of text, this character is not automatically validated using the Feature Manager. It is recommended that you create validation rules for the field using the Regular Expression or Execute SQL checks.

July x, xxxx

s

Displays the seconds without leading zeroes, ranging from 1 to 59, in a time string

x:xx:3

ss

Displays the seconds with leading zeroes, ranging from 01 to 59, in a time string

x:xx:03

t

Displays the first character in the AM or PM designator in a time string

x:xx A

tt

Displays the AM or PM designator in a time string

x:xx AM

y

Displays the year as two digits without leading zeroes, ranging from 0 to 99 in a date string

x/x/9

yy

Displays the year as two digits with leading zeroes, ranging from 00 to 99 in a date string

x/x/09

yyy or yyyy

Displays the full year, including the century, in a date string

x/x/2009

zz

Displays the offset for Greenwich mean time, in hours, with leading zeroes in a time string.

x:xx -07

zzz

Displays the offset for Greenwich mean time in hours and minutes in a time string

x:xx -07:00

Characters that are parts of date and time formats

関連トピック

4/26/2014