Saltar navegación

[Resuelto] Convert Unix Timestamp in to dd/mm/yyyy

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

My problem is in a view. i have a field "post-date" and it is shown in the front end every time in the unix timestamp.

Solution:

The problem was a plugin which has change the wordpress date format in the unix timestamp.

Relevant Documentation:

This support ticket is created hace 5 años, 9 meses. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por SteffenM1628 hace 5 años, 9 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#1218333
Bildschirmfoto 2019-03-20 um 18.13.14.png

Hey there,
my problem is in a view. i have a field "post-date" and it is shown in the front end every time in the unix timestamp.

Could you help me fix this with javascript?
my id of the dat is #datestamp.
Therefore i am very bad in jquery or javascript.

hope you can guide my with a simple function on pageload.

Thank you so much.

#1218532

Hello,

How do you setup/create the custom field "post-date"?
If it is a custom date field created with Types plugin, you can output the date value as the format you wanted, for example:

[types field="post-date" format="d/m/Y"][/types]

See our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/#date
format:
any valid WordPress date format

If it is a post field created with other plugins/theme, you can also convert it under Types control, then display the field value with above Types shortcode too, see our document:
https://toolset.com/faq/how-do-i-convert-existing-custom-types-and-fields-to-types-control/#converting-custom-fields
Section "Converting custom fields"

#1219059

Hey Luo,

thanks for your reply. Unfortunately it is a bit complicated in my case.
I use the toolset postdate shortcode in an elementor template.
this elementor template sits via its shortcode in a view loop.

And at this point the dateformat changes to the unix.
I know that is not officially supported to put elementor shortcodes in the view loop, but it works very great.
Except for the postdate field. Therefore i need help to get a workaround with javascript to modify the unix back to a dateformat.

hope you can help me fix this!

thank you so much.
cHeers

#1219260

My issue is resolved now.

The problem was a plugin which has change the wordpress date format in the unix timestamp.
Thanks for your help Luo.