data grid control

Advanced Data Grid Control

[ Data Grid Home ] [ Documentation ] [ Examples & Demos ] [ Buy Now ]

Advanced Data Grid Control

Date Format

advanced data grid control
When a Column data type is set to Date it is necessary to specify the date format to be used. This is done by the parameter dateformat
(Note: if no data format is specified then a default format of MM/dd/yyyy is assumed.)

The Date format parameter specifies the pattern that dates will follow in the data. For example if your dates are in the default format you would have,

<param name="dateformat" value="MM/dd/yyyy">

or if the elements of the date were seperated by a "." (rather than a "/"),

<param name="dateformat" value="MM.dd.yyyy">

(Please note: Month is represented by an Upper Case M whilst day and year are lower case d and y.)


Here are some common Date Format Examples

MM/dd/yyyy 04/14/2003
MM/dd/yy 04/14/03
dd MMMM yyyy 24 January 2003
dd/MM/yyyy 28/02/2003
dd.MM.yyyy 28.02.2003
EEE, MMM d, ''yy Wed, April 16 '03


In addition, Time may also be incorporated into the date format. Here are some Examples incorporating Time,

Format Pattern Date Example
yyyy.MM.dd G 'at' hh:mm:ss z 1996.07.10 AD at 15:08:56 PDT
h:mm a 12:08 PM
hh 'o''clock' a, zzzz 12 o'clock PM, Pacific Daylight Time
K:mm a, z 0:00 PM, PST
yyyyy.MMMMM.dd GGG hh:mm aaa 1996.July.10 AD 12:08 PM


As you can see it is possible to define virtually any pattern to match the format of your data. Here are the full range of characters and thier meanings when used within the Date Format parameter,

Symbol Meaning Example
G era designator AD
y year 2003
M Month July or 07
d day in the month 10
h hour in am/pm (1-12) 11
H hour in the day (0-23) 21
m minute in the hour 55
s second in the minute 30
S miilisecond 978
E day in the week Tuesday
D day in the year 234
w week in the year 27
W week in the month 2
a am / pm marker PM
k hour in the day (1-24) 24
K hour in am/pm (0-11) 0
z time zone Eastern Standard Time
« back to Getting Started
[ Data Grid Home ] [ Documentation ] [ Examples & Demos ] [ Buy Now ]

Getting Started