PC Review


Reply
Thread Tools Rate Thread

changing string format

 
 
deepak
Guest
Posts: n/a
 
      11th Feb 2008
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
 
Reply With Quote
 
 
 
 
deepak
Guest
Posts: n/a
 
      11th Feb 2008
sorry the 2nd is

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

Kindly reply me asap.
- Deepak



"deepak" wrote:

> 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

 
Reply With Quote
 
Family Tree Mike
Guest
Posts: n/a
 
      12th Feb 2008
Convert the first to a Date Time:

DateTime dtg;
DateTime.TryParse ("2/12/2008 6:00:00 PM", out dtg);

Then convert the dtg to the output format:

string dtgOutput;
dtgOutput = dtg.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss");


"deepak" wrote:

> sorry the 2nd is
>
> 2nd(datatype string): "2008-2-12T18:00:00"
>
> Kindly reply me asap.
> - Deepak
>
>
>
> "deepak" wrote:
>
> > 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

 
Reply With Quote
 
deepak
Guest
Posts: n/a
 
      13th Feb 2008
yeah its workign now..thanks . u r a man :-)

-Deepak

"Family Tree Mike" wrote:

> Convert the first to a Date Time:
>
> DateTime dtg;
> DateTime.TryParse ("2/12/2008 6:00:00 PM", out dtg);
>
> Then convert the dtg to the output format:
>
> string dtgOutput;
> dtgOutput = dtg.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss");
>
>
> "deepak" wrote:
>
> > sorry the 2nd is
> >
> > 2nd(datatype string): "2008-2-12T18:00:00"
> >
> > Kindly reply me asap.
> > - Deepak
> >
> >
> >
> > "deepak" wrote:
> >
> > > 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing string Format deepak Microsoft Dot NET Framework Forms 3 29th Feb 2008 09:34 PM
changing string format deepak Microsoft ASP .NET 6 11th Feb 2008 06:27 PM
Changing controls based on a DateTime format string gregcm@gmail.com Microsoft Dot NET Framework 0 8th Feb 2008 12:03 AM
DataGrid: changing the URL format string programmatically MattB Microsoft ASP .NET 2 27th Oct 2005 05:22 AM
how to make two references to one string that stay refered to the same string reguardless of the changing value in the string? Daniel Microsoft C# .NET 10 3rd Nov 2004 03:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:23 AM.