Time 'Type' but I need seconds too i.e. HH:MM:SS

Hi - does anyone know how to get the Time ‘Type’ to show seconds in addition to hours and minutes?

Instead of HH:MM, I need HH:MM:SS

Many thanks

Click the f(x) button and apply the following inline formula:

this.strftime('%H:%M:%S')
2 Likes

Thanks. When I put that I get an error:
“error: Could not access blank value: Use || to provide a default value for blank fields. Example: (my_field || 0) + 1”

So - I then added the following code:

(serviceDetails.serviceStartTime || 0) + 1
this.strftime(’%H:%M:%S’)

But I get this error:
“error: Field ‘serviceDetails’ not found”

Note: I’m applying this formula to a field called serviceDetails.serviceStartTime

Can you post the share link at the bottom of the schema?

Sure:

I created a fork of your schema that sets the desired format and computes the end service time by adding a random number of hours to the start time. This ensures that the end is always after the start. My approach was to create a hidden field for the start time, then use formulas to produce the formatted start time and calculated end time:

1 Like

Many thanks, that’s absolutely fantastic. Are there any sites you can direct me to where it has more examples of using formulas like that to get the values I need using Mockaroo?

One thing i’m trying to mock up (but currently failing at) is to produce JSON in the following format:

“serviceDetails”: {
“serviceAttributes”: [
“Leave Safe”,
“High Value”
]

Any pointers with this?

Kind regards

See http://mockaroo.com/help/json

You probably want to define serviceDetailts.serviceAttributes like this:

1 Like

Thanks! I actually just managed to solve this using a JSON Array :slight_smile:

There are some free resource for you to get free data see here https://www.mockaroo.com/9f056960 , or visit this website.

You can get info about transcription.