javascript - Parse serialized date in Grails with proper time zone -


i'm trying bind date in grails app. in application.yml have databindings default javascript date formats:

  grails:     databinding:       dateformats:         - "yyyy-mm-dd't'hh:mm:ss.s'z'"         - "yyyy-mm-dd't'hh:mm:ss'z'" 

in groovy i'm creating object params def entity = new entity(params) , binds ok, but...

the problem have wrong time zone in grails app, i.e.:

  1. in angularjs i'm creating new date - thu oct 22 2015 00:00:00 gmt+0200 (cest) (this string representation of date object)
  2. next i'm sending via $http service, json payload looks this: { date: "2015-10-21t22:00:00.000z", another: "another:, property: "property" }. date looks fine right now, z @ end means utc thu oct 22 2015 00:00:00 gmt+0200 (cest) - 2 hours => 2015-10-21t22:00:00.000z

  3. in grails i'm doing def entity = new entity(params) , here problem, entity.date equals wed oct 21 22:00:00 cest 2015 means groovy/grails parsed string 2015-10-21t22:00:00.000z cest time zone not utc

so how can force grails load date proper format?

ps both web browser , computer working cest time zone.

i'm using grails 3.0

proper datetime string yyyy-mm-dd't'hh:mm:ss.sssx.

in next versions should fixed , javascript datetime strings parsed via default parser.

more:

https://github.com/grails/grails-core/issues/9367 https://github.com/grails/grails-core/issues/9368


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -