Monday, May 30, 2011

Data Format String For GRID VIEW







Format character

Description

Example

d

Short date pattern.

Format: {0:d}

6/15/2009 1:45:30 PM -> 6/15/2009

D

Long date pattern.

Format: {0:D}

6/15/2009 1:45:30 PM ->Monday, June 15, 2009

f

Full date/time pattern (short time).

Format: {0:f}

6/15/2009 1:45:30 PM -> Monday, June 15, 2009 1:45 PM

F

Full date/time pattern (long time).

Format: {0:F}

6/15/2009 1:45:30 PM -> Monday, June 15, 2009 1:45:30 PM

g

General date/time pattern (short time).

Format: {0:g}

6/15/2009 1:45:30 PM -> 6/15/2009 1:45 PM

G

General date/time pattern (long time).

Format: {0:G}

6/15/2009 1:45:30 PM -> 6/15/2009 1:45:30 PM

M or m

Month/day pattern.

Format: {0:M}

6/15/2009 1:45:30 PM -> June 15

O or o

Round-trip date/time pattern.

Format: {0:o}

6/15/2009 1:45:30 PM -> 2009-06-15T13:45:30.0900000

R or r

RFC1123 pattern .

Format: {0:R}

6/15/2009 1:45:30 PM -> Mon, 15 Jun 2009 20:45:30 GMT

s

Sortable date/time pattern.

Format: {0:s}

6/15/2009 1:45:30 PM -> 2009-06-15T13:45:30

t

Short time pattern.

Format: {0:t}





0 comments:

Post a Comment