Skip Navigation

[Resolved] date format

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 4 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1487709

I use Elementor to retrieve the custom date field (slug: event-date) created by Toolset. I put the shortcode [wpv-post-field name="wpcf-event-date"] and it returns a date stamp like 1577750400. How can I format it to the date? I try to use format="Y-m-d" inside the shortcode, but it fails.

#1487949

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

If you created the date type custom field using the Types plugin, you should use the Types shortcode to display the date that will allow you to display the formatted date.

For example:

[types field="event-date" format="Y/m/d g:i:s A"][/types]

More info:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#date

#1488121

My issue is resolved now. Thank you!

#1488829

The date field set by Types is with multiple instances, so the returned values will be like 2020/1/29 2020/1/30 2010/1/31. Can I separate them by comma? That would be easy for the visitors to read.

#1489661

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You can use the separator attribute to separate the multiple instance date field vlaue:

For example:

[types field="event-date" separator=","  format="Y/m/d g:i:s A"][/types]

More info:
=> https://toolset.com/documentation/user-guides/custom-content/repeating-fields/#Displaying%20Repeating%20Fields