【问题标题】:My timepicker addon uses the wrong timezone我的时间选择器插件使用了错误的时区
【发布时间】:2018-10-19 12:33:37
【问题描述】:

我在我的日期选择器中添加了一个时间选择器。一切正常,但是当我发帖时,时间会增加 2 小时(我认为这在 js 中有点)。

有人知道这个问题并知道如何解决吗?

我插入的日期时间是2018-10-09 09:002018-10-09-12:00

【问题讨论】:

  • moment js上定义日期时显示代码
  • @AlexanderVillalobos: dayClick (mom) { //, jsEvent, view EventBus.emit('populate-event-modal', { start: mom.add(7, 'hours'), end: mom.clone().add(1, 'hours') }); },

标签: laravel momentjs jquerydatetimepicker


【解决方案1】:

请检查您的config/app 文件中的应用程序时区。

我的例子:

/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/

'timezone' => 'Europe/Kiev',

【讨论】:

  • 不,这不是问题所在。我认为这是momen js中的东西。
  • self.$emit('update', moment(dateString, 'DD-MM-YYYY HH:mm'));问题就在这里。但我不知道如何解决它
猜你喜欢
  • 2017-02-12
  • 2018-10-17
  • 2021-06-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多