简体   繁体   English

datetimepicker中时区的用途是什么

[英]what is the use of timezone in datetimepicker

I am using Datetimepicker for date and time input. 我正在使用Datetimepicker进行日期和时间输入。 But i am not able to understand what is the use of timezone option in it. 但是我不明白时区选项的用途。 I mean when i submit the input to datetime datatype in mysql and then select back what changes i am going to face because of timezone. 我的意思是,当我将输入提交到mysql中的datetime数据类型,然后选择回时区时,我将要面对的更改。 I am not able to get it. 我无法得到它。 Please help me. 请帮我。 I am using this code for datetimepicker. 我将这段代码用于datetimepicker。

$(document).ready(function() {
    $('#datepicker').datetimepicker({  
      showSecond: true,
      dateFormat: 'yy-mm-dd' ,
      timeFormat: 'HH:mm:ss',
     showTimezone: true,
     LocalTimezone: false,  
      stepHour: 1,
      stepMinute: 1,
      stepSecond: 10

     });  

  });

I have found this 我发现了这个

"showTimezone?: boolean; //Default: null - Whether to show the timezone selector not when selecting the date picker". “ showTimezone ?: boolean; //默认值:null-选择日期选择器时是否不显示时区选择器”。

for more details please use this https://github.com/borisyankov/DefinitelyTyped/blob/master/jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts 有关更多详细信息,请使用此https://github.com/borisyankov/DefinitelyTyped/blob/master/jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts

My guess: 我猜:

not because of timezone but your dateFormat set doesn't match datetime type in your database. 不是因为timezone而是您的dateFormat设置与数据库中的datetime类型不匹配。

try set dateFormat to YYYY-MM-DD 尝试将dateFormat设置为YYYY-MM-DD

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM