26-04-23 09:41 AM
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?
26-04-23 01:22 PM
Ho Connor,
Does the interface accept correct formatting if you populate the date manually?
Happy coding!
---------------
Paul
Sweden
26-04-23 01:48 PM
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
26-04-23 02:01 PM
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.
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
Following is a code that gives you output as seconds
Calculation stage for AM timing
Calculation of PM time
Now if we use text it has no conversion, hope this helps.