Skip Navigation

[Resolved] Form datepicker output consistent with WordPress time zone

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 1 reply, has 2 voices.

Last updated by Minesh 1 year, 6 months ago.

Assisted by: Minesh.

Author
Posts
#2651405

Tell us what you are trying to do?
My form includes a date time field to report time of observation. The datepicker is not respecting the time zone selected in WordPress. When I select a date/time, the result appears to be UTC+0. Is there any way to set the CRED datepicker time-zone?

Is there any documentation that you are following?
I have examined many threads on the jQuery UI datepicker but have not found anything that solves my problem.

Is there a similar example that we can see?
I find that datepickers generally get configured to output a date/time, or at least show the user a date/time, that is consistent with their regional settings / time zone.

What is the link to your site?
hidden link

#2651499

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

What if you try to use the function shared by Nigel with the following reference ticket:
- https://toolset.com/forums/topic/universal-time-for-toolset-date-field-in-wordpress-admin/page/2/#post-2639189

You can use the function to convert your selected date timestamp and pass your desired timezone to covert to and save the return value to the database. You can update the custom date field value based on the funtions's return value using the "cred_save_data" hook.
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

Please let me know if you will require further assistance for that.