Support

Account

Home Forums General Issues Zulu time in Date picker Reply To: Zulu time in Date picker

  • It’s an issue with changing from using local time to using Z time. The date time picker and the time picker both depend on the jquery date picker. This script picks up the local time on the computer where the browser is being run and has nothing to do with the date as set on the server, or in WP settings.

    I just tested the above, I created one each of the 3 field types (date, time and date/time). I went to edit a page and today/now were my local time. I then changed my computer clock settings, both date and a different hour. When I reloaded the page all fields picked up this new date and time as the current date and time.

    All of which are completely independent of the server, the server where my test site is located is in a completely different time zone than I’m in. And this time is also independent of the time zone set in WP settings which is set to yet another time zone that is not the same as either myself of where the server is located.

    I know it sounds like a lot, but in order to alter the way the picker works you need to do so on the JS side.

    Even then you can never be sure. It would be a simple thing for anyone to set their time zone to whatever they wanted and then change their clock to a day and time that does not correspond to any real world date/time in any time zone, thus making any calculation to get the Z date/time irrelevant.

    I did just find this, and it is possible to use the servers date/time as the default https://stackoverflow.com/questions/5011644/supplying-local-time-generated-from-server-to-jquery-datepicker so it is possible, but then we’re back to my first reply, and I don’t have any code that will help you with this. I did find a couple of other people looking for the same answer but I did not find any answers https://www.google.com/search?q=acf+use+server+date+for+date+picker.