PC Review


Reply
Thread Tools Rate Thread

How to convert a date string to datetime value with custom date format?

 
 
ABC
Guest
Posts: n/a
 
      29th Sep 2005
How to convert a date string to datetime value with custom date format?

e.g.
Date String Date Format Result (DateTime value)
"05/07/2004" "MM/dd/yyyy" May 7, 2004
"01062005" "ddMMyyyy" June 1, 2005
"09-07-05" "MM-dd-yy" Sept 7, 2005

Is there any functions to convert?


 
Reply With Quote
 
 
 
 
Maqsood Ahmed
Guest
Posts: n/a
 
      29th Sep 2005
Hello,
You can use DateTime.Prase static method. You will have to provide the
format (IFormatProvider) using the
System.Globalization.DateTimeFormatInfo class. Please see MSDN for the
1. DateTime.Prase method
2. DateTimeFormatInfo class

HTH. Cheers.

Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
 
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
Convert a special date string to DateTime maflatoun@gmail.com Microsoft Dot NET 1 2nd Jun 2007 12:06 PM
Convert a latebinded DataTable column's format from DateTime to string (or format the date time value) RSH Microsoft VB .NET 0 6th Dec 2006 03:49 PM
Convert date() to DateTime format Ryan Ramsey Microsoft C# .NET 1 21st Jul 2006 07:47 AM
How to convert user-defined custom format date string to date value abcabcabc Microsoft VB .NET 1 19th Aug 2005 12:31 PM
Any easy way to convert DateTime to Xml Date format Q. John Chen Microsoft C# .NET 2 8th Jul 2005 11:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:44 AM.