changing string format

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
 
D

deepak

sorry the 2nd is

2nd(datatype string): "2008-2-12T16:00:00"

Kindly reply me asap.
- Deepak
 
D

deepak

sorry the 2nd is

2nd(datatype string): "2008-2-12T18:00:00"

Kindly reply me asap.
- Deepak
 
L

lue

Here if VB.NET code

Dim dt As DateTime

Dim strDt

dt = Format(#2/12/2008 3:23:00 PM#, "dddd, d MMM yyyy h:m:ss tt ")

strDt = Format(dt, "yyyy-MM-d%T h:m:ss tt")



Lue
 
D

deepak

Hi Lue,

its giving me finally "2008-02-12T 6:0:00 PM" but i need it as "2008-02-12T
18:00:00"

-Deepak
 
L

lue

Yes just format the 2nd one as following
Dim dt As DateTime

Dim strDt

dt = Format(#2/12/2008 6:00:00 PM#, "dddd, d MMM yyyy hh:m:ss tt ")

strDt = Format(dt, "yyyy-MM-d%T HH:m:ss")


Lue
 
D

deepak

yeah lue,its woroking...ur great lue....thanks......Ma i add u in msn ..also
i may have some more questions in the coming hours....Kinldy help me...u
dont know u helped so much in this way .. i can not forget really....:)

- Deepak
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top