---
title: "How do I convert string value to a date format"  
description: "How do I convert string value to a date format"  
author: "Samuel Fernandes"  
published: 2014-01-25  
updated: 2014-01-25  
canonical: https://www.mindstick.com/forum/1872/how-do-i-convert-string-value-to-a-date-format  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How do I convert string value to a date format

How do I [convert string](https://www.mindstick.com/forum/159139/convert-string-to-date-in-oracle-sql) [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) to a [date format](https://www.mindstick.com/forum/1976/date-format-comparison-issue)

```
string strDateFrom;string strDateTo;              CrystalDecisions.Shared.ParameterDiscreteValue DateValue =
new CrystalDecisions.Shared.ParameterDiscreteValue();if ((strDateFrom != "") && (strDateTo !=""))      {                                          DateValue.Value ="(From: " + strDateFrom + " - " + strDateTo +")";}     else     {    DateValue.Value ="(ALL DATES)";    }
```

## Replies

### Reply by Pravesh Singh

Hi Samuel,

You can use DateTime.Parse

```
string date = "2020-02-02";    DateTime time =
DateTime.Parse(date);   
Console.WriteLine(time);Or use:DateTime oDate = DateTime.Parse(string s);
```


---

Original Source: https://www.mindstick.com/forum/1872/how-do-i-convert-string-value-to-a-date-format

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
