PC Review


Reply
Thread Tools Rate Thread

converting date string into datetime object

 
 
Glenn M
Guest
Posts: n/a
 
      21st Jul 2004
I have a date stored as a string in the format mm/dd/yyyy.
What is the easiest way to get this date converted to a datetime
object so i can include it in the datediff function.

also what is the method i should use to return a date string back from
the datatime object, possibly in a different format such as dd/mm/yyyy

glenn
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      21st Jul 2004
* (E-Mail Removed) (Glenn M) scripsit:
> I have a date stored as a string in the format mm/dd/yyyy.
> What is the easiest way to get this date converted to a datetime
> object so i can include it in the datediff function.


'DateTime.Parse'/'DateTime.ParseExact'.

> also what is the method i should use to return a date string back from
> the datatime object, possibly in a different format such as dd/mm/yyyy


'DateTime.ToString'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
 
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
converting string to datetime zino Microsoft VB .NET 5 19th Dec 2007 08:06 PM
Converting a date string to a DateTime. Example please Kim Hellan Microsoft C# .NET 10 13th Oct 2005 06:24 PM
converting Unix datetime count to .Net DateTime object Mark Worrall Microsoft Dot NET Framework 2 13th Feb 2004 05:52 PM
Re: converting Unix datetime count to .Net DateTime object Mark Worrall Microsoft C# .NET 1 4th Feb 2004 07:29 AM
converting Unix datetime count to .Net DateTime object Mark Worrall Microsoft Dot NET 1 4th Feb 2004 06:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:34 AM.