Date format
-
I would like to write hungarian style formatted dates to response. The hungarian short date format is "yyyy.MM.dd.". I have tried the following settings: Session.LCID = 1038 or Thread.CurrentThread.CurrentCulture = New CultureInfo(1038) Thread.CurrentThread.CurrentUICulture = New CultureInfo(1038) (1038 is the hungarian locale ID). The result is allways the same, the displayed date format is "M.d.yyyy" (which seems to be the general date format). If I write a Windows application instead of web application the date formatting is correct again... Any idea? Thanks! (K)
-
I would like to write hungarian style formatted dates to response. The hungarian short date format is "yyyy.MM.dd.". I have tried the following settings: Session.LCID = 1038 or Thread.CurrentThread.CurrentCulture = New CultureInfo(1038) Thread.CurrentThread.CurrentUICulture = New CultureInfo(1038) (1038 is the hungarian locale ID). The result is allways the same, the displayed date format is "M.d.yyyy" (which seems to be the general date format). If I write a Windows application instead of web application the date formatting is correct again... Any idea? Thanks! (K)
you have to set the culture in order to set the dateformat, I 've had so many problems with the DateTime Object that I eventually made one myself. This way I at least now what to expect. good luck. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
-
I would like to write hungarian style formatted dates to response. The hungarian short date format is "yyyy.MM.dd.". I have tried the following settings: Session.LCID = 1038 or Thread.CurrentThread.CurrentCulture = New CultureInfo(1038) Thread.CurrentThread.CurrentUICulture = New CultureInfo(1038) (1038 is the hungarian locale ID). The result is allways the same, the displayed date format is "M.d.yyyy" (which seems to be the general date format). If I write a Windows application instead of web application the date formatting is correct again... Any idea? Thanks! (K)
The easy way is:
string strDateInYourFormat = dateMyDate.ToString("yyyy.MM.dd");
Good luck! -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!