Change decimal time format to time

How can i change below highlighted item to time format (00:00 AM/PM)?

Thank you

RPA|383x499

Hi @Edd_0820,

Best way change the format in excel itself.

If you want to convert the time using code try the below

DateTime.FromOADate(0.614375).ToString(“hh:mm tt”)

is it mean change e.g 0.80335648 to datetime first?

Yeah change the entire column to Time format in excel

but i want change it in RPA , is it possible?

Yes possible follow the steps

  • Read the excel using Excel activity
  • Loop the datatable using ForEach Row activity
  • Create a new column as string
  • Then assign like below

row("New Col") = DateTime.FromOADate(row("SliceRm In time")).ToString("hh:mm tt")

Convert.ToDateTime(now).tostring( datetime format )
now = “variable”

Below message is shown

It is okay now

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.