I'm using this datetimepicker jquery plugin: http://xdsoft.net/jqplugins/datetimepicker/ and I didn't get it how to use timezone. I saw the documentation, but I couldn't find it.
What I tried to do is something like that:
serviceDateTime.datetimepicker({
lang: 'pt-BR',
format: 'd/m/Y H:i',
mask: true,
step: 30,
showTimezone: true,
timezone: "-0200"
});
Any help? Thanks in advance!
This was difficult to find in the documentation, but you can pass O
in format
to tell the plugin to pass the GMT offset.
serviceDateTime.datetimepicker({
lang: 'pt-BR',
format: 'd/m/Y H:i O',
mask: true,
step: 30,
showTimezone: true,
});
The detective work was to find
https://xdsoft.net/jqplugins/datetimepicker/#use_other_date_parser
Then from there https://github.com/kartik-v/php-date-formatter#features
Then follow http://php.net/manual/en/function.date.php and search page for
"Difference to Greenwich time (GMT) in hours"
The plugin is simply used to give the user an interface to pick date and time.
If you're concerned about the display to be based on your timezone, see if this helps:
Accounting for Timezone with jQuery datepicker
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With