Changing string Format

  • Thread starter Thread starter deepak
  • Start date Start date
D

deepak

Hi All,

How to convert the 1st format of string to 2nd one in vb.net

1st(datetype string) : "2/12/2008 6:00:00 PM"
2nd(datatype string): "2008-2-12T17:00:00"

note: in 2nd string ,the T is just a alpahbet

Thanks,
Deepak
 
sorry the 2nd one should be "2008-2-12T18:00:00".Kinldy reply me plz

-Deepak
 
deepak said:
How to convert the 1st format of string to 2nd one in vb.net

1st(datetype string) : "2/12/2008 6:00:00 PM"
2nd(datatype string): "2008-2-12T17:00:00"

note: in 2nd string ,the T is just a alpahbet


'DateTime.ParseExact'/'DateTime.ToString'.
 
check blog bypsoft.blogspot.com It speaks about DateTime to string formatting (actually about miliseconds handling but you will find answer on your question). In general, convert 1st string to DateTime and then use ToString(<format>) on that DateTime variable with proper format.

DLM@bypsoft
Compare databases (SQL Server, MySQL, Oracle) for free.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top