how to convert date in .net

  • Thread starter Thread starter DOT_NET
  • Start date Start date
D

DOT_NET

how to convert the date
i'm getting date like that:

Mon Sep 1 00:00:00 PDT 2003

its in javascript:

convert to:

09/01/2003
 
Hey,

You can use Cdate to convert the time, since a long date format is not
recognized if it contains a day-of-the-week string, such as "Wednesday".
You can modify your string as following

Dim a As String = "Mon Sep 1 00:00:00 PDT 2003"
Dim b As String = a.Replace("00:00:00 PDT", "")
b = b.Substring(3)
Dim d As Date = CDate(b)

Then you can get the date in the correct format

Hope it helps.

Aiwen Guo, VB Team
 
Back
Top