[Help Needed] Want to format the date and time in text element

Please the screenshot below where i’m getting this in API response field.

I want to format this date in the text element “Jul 12 06:30” in this format.

When i try to formatit in text element it won’t give option to format the date.
Is there any other way to format the date in text?

What is the type/format of the date as returned by the API?

In the above screenshot i have marked it.

@adamhholmes in API response it comes in Text format.

There might be a plugin or two that can convert a text to a date…

Otherwise you’ll have to construct a ‘date’ yourself, then format it however you like…

You can use an arbitrary date (or current date/time), then change the year, month, date, and time etc. to the value from the text using the :split by operator. (you’ll need to convert each part of the text into a number).

It’s a bit fiddly, but perfectly doable…

1 Like

@adamhholmes
I haven’t found any relevant plugin for Text to Date conversion.
Can we convert it into date using HTML element?

I guess you could use some javascript to do something similar to what I’ve outlined above… or perhaps there are some JS libraries you could use…

@adamhholmes

Can you explain more detailed idea about the second solution you have given?
Use of a arbitrary date. As i’m getting the list in API response, how can i store the text value in arbitrary date and then format it again.

@adamhholmes
For conversion i’m using Expression element from toolbox plugin.
in first screenshot you can see creating new Date().

Then in text element i’m formatting it in a custom format.

The final result in the text element where time is not formatting.


after formatting the time is 06:07 where the original time was 06:30 .
What must be the reason behind not formatting the time?
Am i doing it the correct way ?

after formatting the time is 06:07 where the original time was 06:30 .
What must be the reason behind not formatting the time?
Am i doing it the correct way ?

m = month
M = minutes

You’re formatting it as hh:mm which is Hours:Month (hence 07 for July)

Minutes requires a capital M (MM)

1 Like

@adamhholmes
Yes… I didn’t realised this. I made changes and its working perfectly.
Thanks a lott. Also thank you for your quick reply.

@adamhholmes
This is another problem i’m facing with repeating group.
Can you please look into this post?

This topic was automatically closed after 70 days. New replies are no longer allowed.