cancel
Showing results for 
Search instead for 
Did you mean: 

Time being converted from HH:mm:ss to hh:mm:ss format on input

ConnorStokes
Level 2

As title says, when trying to write or global send keys a time data item in the format "HH:mm:ss" it gets converted automatically to "hh:mm:ss". 

For example 00:00:00 is getting converted to 12:00 AM on input but the input field will not accept this. 

Is there anyway to prevent this automatic conversion?

3 REPLIES 3

PvD_SE
Level 12

Ho Connor,

Does the interface accept correct formatting if you populate the date manually?

Happy coding!
---------------
Paul
Sweden

Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

ConnorStokes
Level 2

Hi Paul, 

Yes the field will accept manual input as long as its not 00:00:00 and it is in the format "HH:mm:ss". Anything else it will reject. 

The time data item where the input data is stored is correctly holding it in the "HH:mm:ss" format. Its only getting converted upon either global send keys or write stage input.  Worth noting that time in the format "HH:mm:ss" also gets converted to "hh:mm:ss" when converting from a time data item to a text data item. Id guess this is what's happening here as the input for a global send key action is type 'text'.

Thanks,
Connor

Babjee24
Level 7

Hi @ConnorStokes ,

As far as I understand from the conversation I see the issue is with time data item, I don't see anything to stop the conversion from "HH:mm:ss" to "hh:mm:ss" hence converted the time to text equivalent with few steps.  Attaching the screenshot of the flow for converting time to text.

35485.png
Save Time to a Text Variable -- This calc will store Time to a text type that has AM/PM

Get Seconds -- Gives the number of seconds in the Time data item. I_Time is the input parameter for action and the code stage, O_Seconds is the output parameter for action and code stage
35486.png
Following is a code that gives you output as seconds

35487.png
 Calculation stage for AM timing

35488.png

Calculation of PM  time
35489.png
Now if we use text it has no conversion, hope this helps. 

Babjee Vangipurapu
Senior RPA Developer
India