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.:
- in angularjs i'm creating new date -
thu oct 22 2015 00:00:00 gmt+0200 (cest)
(this string representation ofdate
object) 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 utcthu oct 22 2015 00:00:00 gmt+0200 (cest)
- 2 hours =>2015-10-21t22:00:00.000z
in grails i'm doing
def entity = new entity(params)
, here problem,entity.date
equalswed oct 21 22:00:00 cest 2015
means groovy/grails parsed string2015-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
Post a Comment