How do i change the date format from MM/dd/yyyy to dd/MM/yyyy?
Printable View
How do i change the date format from MM/dd/yyyy to dd/MM/yyyy?
What do you mean? In a computer? In a string? In a DateTime? Or what?
the string is in dd/MM/yyyy format, but whenever I convert it using this code:
It takes it into mm/dd/yyyy format for some strange reason.vb.net Code:
DATE1 = Date.ParseExact(tmp, "dd/MM/yyyy", Nothing)
Also gives me error on dates like 5/4/2010
It doesn't take it into any format. A Date object doesn't have any format at all. The IDE displays any and all dates in M/dd/yyyy format but that is just how the IDE displays it. It doesn't mean anything about the Date value itself, which is simply a number. No Date object has any format at all. It's only when you display the Date to the user, i.e. convert it to a String, that format is an issue. Rememebr this: a Date object has NO FORMAT at all. It's only when converting a Date to a String or a String to a Date that format is an issue.
Oh ok. Thanks for clearing that up for me.