Change decimal time format to time

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

Thank you


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


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