wondery Posted October 13, 2003 Posted October 13, 2003 my country using dd/mm/yyyy and it hard to fig at regional seting of each client computer so i want to allow they key dd/mm/yyyy and when i add to database i want to convert to mm/dd/yyyy how do i do ? did .net had function to get only day, month and year ? i will rearrage it before add to database or another way suggest ? Quote
*Experts* Nerseus Posted October 13, 2003 *Experts* Posted October 13, 2003 If you have the value in a DateTime object (or in a column in a DataSet cast as a DateTime), you can use the DateTime's ToString overload to specify the format, such as: string s = dateVal.ToString("dd/MM/YYYY"); I think I saw another thread here where someone did something simpler (such as changing a DB option or using the built-in localization objects - or is it globalization, one for UI one for code -can't rememember). -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.