R
Rod Billett
There have been many posts related to displaying a Formatted Date, but none
referenced how to adapt to the Browsers Culture. I tried using the {0:d} as
others have posted, but this reverts to the current Threads ShortDateFromat
and not the browsers format.
To format a Date Column within a datagrid to the browsers culture (
Tools>Internet Options> Languages...)
do the following on your column
System.Globalization.CultureInfo ciO =
System.Globalization.CultureInfo.CreateSpecificCulture(this.Context.Request.
UserLanguages[0]);
DateColumn.DataFormatString = "{0:" + ciO.DateTimeFormat.ShortDatePattern +
"}";
Given a date of May 24th, 2003 the date column will be formatted as follows
US = 5/24/2003
French = 24/5/2003
Hope this Helps someone out...
Rod
referenced how to adapt to the Browsers Culture. I tried using the {0:d} as
others have posted, but this reverts to the current Threads ShortDateFromat
and not the browsers format.
To format a Date Column within a datagrid to the browsers culture (
Tools>Internet Options> Languages...)
do the following on your column
System.Globalization.CultureInfo ciO =
System.Globalization.CultureInfo.CreateSpecificCulture(this.Context.Request.
UserLanguages[0]);
DateColumn.DataFormatString = "{0:" + ciO.DateTimeFormat.ShortDatePattern +
"}";
Given a date of May 24th, 2003 the date column will be formatted as follows
US = 5/24/2003
French = 24/5/2003
Hope this Helps someone out...
Rod