Convert String to DateTime(String not valid datetime)

@supu123 Still it doesn’t Work ? If So, Can you show me what you have assigned for strTestDate?

Hi @supermanPunch

Hi @Manish540

Same error is thrown for the mentioned code as well

Regards,
Supriya

@supu123 Can you show me What have you used in the Assign for strTestDate?

StartProcess.xaml (66.7 KB)

I have uploaded the xaml

Regards,
Supriya

@supu123 you’re using a Colon : at the end of the Format :sweat_smile:

@supu123 Use this :
StartProcess.xaml (66.7 KB)

Hi,
I got the solution

But I have a query
If the month changes from single digit to double the code will not effect ?
Regards,
Supriya

Thank you so much for ur help

@supu123 Ohh wait i guess it will :sweat_smile:

@supermanPunch
No it is not afffecting I have tested it

Regards,
Supriya

Hi @supermanPunch

If I want Milliseconds also than what would be its format

Regards,
Supriya

@supu123 I did not get any format which can be converted from string “2/13/20 22:35:42:846” to DateTime beacuse of the Colon : After 42 if it was a dot " . ", we could have Converted it :sweat_smile:

Now the Option is to Replace the last Colon by a Dot and convert it into DateTime, But i don’t really knowif that’s what you need

@supu123 Also I don’t think the Replace and Substring works for Month being a Double Digit as well as Day being a Single Digit :sweat_smile:
I’ll try to make a workaround

Hii,

By replacing: by . also it is not working i will consider till seconds only

How to convert this Datetime t o minutes

Regards,
Supriya

@supu123 Ok If you want till Seconds , I will give you the xaml File , Some modifications need to be done for Previous Substring function :sweat_smile:

@supermanPunch

Ok

Regards,
Supriya

Remove the brackets and ‘GMT+5:30’ part from the string. Then use the below code

Datetime.ParseExact(strTime,"M/d/yy hh:mm:ss:fff", System.Globalization.CultureInfo.InvariantCulture)

@supu123 ok Check this, This Should work for all the Dates, if it’s a single digit or double digit month, Single Digit Day or Double Digit Day but only upto Seconds

StartProcess.xaml (67.2 KB)

Hi @kannanSuresh

Not a valid date time format

Regards,
Supriya

@supu123 I Still have one Question will the Number of digits in MilliSeconds vary :sweat_smile: