Parsing a date to a specified format

bloukewer

Well-known member
Joined
Jul 2, 2004
Messages
88
Programming Experience
3-5
Im having some trouble parsing a date to a required format.

I am aware of the Date.ParseExact() method, but I am not sure how touse it. To be more precise, I am not familiar with the parametertypes required by the method.

The format I want to parse the date/string into is: dd/mm/yyyy

Any help would, as always, be appreciated.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
one method is to use the toString function with the format parameter:
VB.NET:
date.toString("yy/MM/dddd")
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
suddenelfilio said:
or Format(date, "dd/MM/yyyy")
that does work for up to vb.net 2003 i'm not sure but i dont think they're going to include the Format function in vb.net 2005 and higher, the ToString("dd/mm/yyyy") is the replacement and should be used in all .net applications
 
Top Bottom