I would like to convert the time format from 12 hours to 24 hours

Hi

Let’s take you have string in an input string variable named strinput

Use a assign activity like this

stroutput = DateTime.ParseExact( strinput.padleft(11,CChar(“0”)),“hh:mm:ss tt”,System.Globalization.CultureInfo.InvariantCulture).ToString(“HH:mm:ss”)

The reason why I have pad left is what if time is 10:12:34

Now you have the time format set as h:mm:ss
If it comes in this format hh:mm:ss

Then it has to manage that also

So the above expression will cover all the scenarios

For more details on DateTime

Cheers @satish_kumar

1 Like