Linked Questions
71 questions linked to/from How to parse strings to DateTime in C# properly?
1
vote
7
answers
38k
views
How to convert a Textbox String to a Datetime in asp.net c#? [duplicate]
How can I convert a textbox string to datetime in asp.net c# ?
I tried this:
DateTime d2 = Convert.ToDateTime(tbx_Created.Text);
string createdformatted = d2.ToString("MM/dd/yyyy hh:mm:ss tt");
...
-1
votes
1
answer
9k
views
Datetime parse not working c# [duplicate]
I am trying to read date from excel using code
String ss = (String)w.Cells[2 + i, 4].Value2;
dRow[3] = DateTime.Parse(ss);
Code works when ss = "12/11/2015" but gives error
String was not ...
0
votes
3
answers
2k
views
How to check if a string in yyyyMMddHHmmss format in C#? [duplicate]
I want to check if a string is in yyyyMMddHHmmss format in C#. What is the best way to do it.
Here I have tried with DateTime.TryParse, but it always return false.
string currentFileName = "...
-1
votes
1
answer
3k
views
Check if string is a valid date, and if it is, whether it is in a specific range [duplicate]
So i'm trying to validate date in format DDMMYYYY.
string date = "12031996";
i want to be able to validate if what user entered is in this specific format. And also want to be able to check if the ...
-3
votes
4
answers
5k
views
Convert Changing string to DateTime in C# [duplicate]
I have one date in string "18/07/2013 04:25:28 PM".How to convert this string to DateTime in c#.When I am trying to convert it into Date time I am getting an error
"Input String is not in correct ...
-7
votes
2
answers
2k
views
String date to DayOfWeek [duplicate]
This code is a simplified version of what I'm trying to do:
this.dateValue = "8/12/2005";
return DateTime.dateValue.DayOfWeek.ToString();
I want to use my dateValue in stead of 'NOW'
-1
votes
2
answers
1k
views
Convert date string into DateTime [duplicate]
How to get DateTime from string: (I don't know what format it is)
Wed Jan 08 2014 00:00:00 GMT+0100 (Central Europe Standard Time)
To DateTime?
1
vote
3
answers
237
views
Why this double value cannot be converted [duplicate]
In the above code, I am getting the date data from SpreadsheetDocument. The exampled date cannot be converted.
But other dates can be converted.
Why cant i convert this date and how can I convert it ...
-3
votes
1
answer
646
views
How to convert strings to DateTime C# [duplicate]
I have 3 separate strings with the following format:
01-29-2016: a date, picked from a bootstrap datepicker
1:00am start time, picked from a dropdown, format could also be e.g. 10:00pm
2:30am end ...
-3
votes
2
answers
2k
views
How to convert string to DateTime in C#? [duplicate]
I have a string and I want to convert it from string to datetime. When I'm trying its giving exception.
Please suggest me how to do.
string stime = "2014-02-02T24:00:00";
DateTime dtStartDateTime = ...
-9
votes
2
answers
3k
views
How to convert 'dd-MM-yyyy' to 'yyyy-MM-dd'? [duplicate]
I have a MySQL DateTime column that I need to query using C#. The problem is that when I try to query the column with the DateTime format of 'dd-MM-yyyy' it doesn't bring back any data but it does ...
0
votes
3
answers
334
views
Parsing a specific string to a DateTime [duplicate]
Possible Duplicate:
Parse string to DateTime in C#
I am getting date and time returned from an API as a string in the following format:
Mon Aug 13 15:04:51 -0400 2012
Does anyone have experience ...
-3
votes
1
answer
233
views
Parsing string into DateTime [duplicate]
I have a string and I have to convert it into DateTime type.
'11 Jun 2015 (12:10)'
I have to parse it into DateTime. I have used DateTime.Parse("MyDateString") but it is throwing an exception.
...
-3
votes
2
answers
868
views
How to convert different dates with string format to specific format like YYYYMMDD [duplicate]
I am trying to convert different string date formats to a specific format i.e., YYYYMMDD and all the incoming dates are valid. How can I return a new list of strings representing this format
0
votes
1
answer
401
views
Date format issue dd/mm/yyyy C# [duplicate]
Needing expert advice for date format issue . I have a string value strDate= "03/04/2018" which is dd/mm/yyyy . I am trying to convert into format dd mmm yyyy . If I use (Convert.ToDateTime(strDate))....