How to concatenate 2 string datetime values in C# ? I have these 2 variables as shown below :
string a = "03-10-2022 15:20"; --> this is the datetime value
string b = "10024.45"; --> this is just milliseconds
string c = a + ":" + b; --> this is concatenating 2 variables to get a
DateTime value with milliseconds.
Now the value of c is
c = "03-10-2022 15:20:10024.45"
I want to create (NOT Convert) a new DateTime value (with millisecond) from the variable c ? Something like
DateTime dt = new DateTime(c);
Don't use any datetime functions. I just want to "Concatenate" datetime var and millisecond var and create a new Datetime values with milliseconds from it.
This is for plotting the X axis of a chart. The x axis values will be like :
03-10-2022 15:20:10024.45,
03-10-2022 15:25:11324.25,
03-10-2022 15:35:678.35, etc
Please help me to create a new datetime value with millisecond from a string ???
When I tried like this, it threw error saying that invalid data format - DateTime.
DateTime dt = DateTime.Parse(c); // error saying invalid
// data format : DateTime.