C# Getting Just Date From Timestamp

Posted by Soo on Stack Overflow See other posts from Stack Overflow or by Soo
Published on 2010-05-18T13:37:41Z Indexed on 2010/05/18 13:40 UTC
Read the original article Hit count: 304

Filed under:
|
|

If I have a timestamp in the form: yyyy-mm-dd hh:mm:ss:mmm

How can I just extract the date from the timestamp?

For instance, if a timestamp reads: "2010-05-18 08:36:52:236" what is the best way to just get 2010-05-18 from it.

What I'm trying to do is isolate the date portion of the timestamp, define a custom time for it to create a new time stamp. Is there a more efficient way to define the time of the timestamp without first taking out the date, and then adding a new time?

© Stack Overflow or respective owner

Related posts about c#

Related posts about timestamp