TestProject Forum

Possible to get DD Format to return without the leading Zero?

Sorry for the ongoing spammage here, I appreciate everyone that has helped so far on the journey.

I have automating a date picker and have it fully functional, to randomise a dob, with someone 18-100 currently, and split and navigate around the date picker.

My problem is I have an intermittent failure when the DD value is less than 10. Example 05/12/1976

Is there anyway to get the DD value to return as just 5/12/1976 when the DD value is less than 10 (I am trying not to break into Code as this is truly a proof of concept currently)

Any pointers, or even a no this is not possible, would be much appreciated

i used the “Get Future or Past Date” to help randomise with some random parameter inputs

Kind Regards

Not sure if theres a better way of sorting this, but ive worked around it by using the below with a condition on the step of if the number is equal to 9 or under:

If theres a better way please feel free to tell me how stupid I am :slight_smile:

Hello @gavin.hewitt
That is a good solution as well.
You can also use Conditions although it is a longer solution.

You can take the date and format it to returns only the date using the Get Current Date in format action as we’ve seen.

Then the next step will be another Get Current date with a different format but the condition for this step will be if the previous value from the DD format is smaller than 10.