Date in data.yml

283 views
Skip to first unread message

svenkubiak

unread,
Jul 1, 2011, 8:39:19 AM7/1/11
to play-framework
Hey,

Just to make sure this is the correct way:

I filled my data.yml with initial data objects. Some of them have a
date field. I converted all dates and times to UTC. When the data is
loading play converts the data to my local timezone, which in my case
is exactly what i want. I guess this is how it just be suppose to be,
or not?

Regards
Sven

alotatakada

unread,
Jul 2, 2011, 4:49:26 PM7/2/11
to play-framework
This happened to me as well. I actually didn't want Play to do this
conversion and have posted here:

http://groups.google.com/group/play-framework/browse_thread/thread/6e25926c53b29d3c/ee2514df5000ac36?lnk=gst&q=YAML#ee2514df5000ac36

Unfortunately, no one seems to know how to control this behavior and
the default (which is good for you) is all you get.

- Paul

alotatakada

unread,
Jul 2, 2011, 6:28:36 PM7/2/11
to play-framework

Explanation can be found here:

http://groups.google.com/group/play-framework/browse_thread/thread/6e25926c53b29d3c/ee2514df5000ac36?lnk=gst&q=YAML#ee2514df5000ac36

If you don't want the dates to be converted into your local time zone
from UTC... so no time zone conversion... put single quotes around
your dates and make sure your application.conf for dates is set to
exactly this (case matters):

date.format=yyyy-MM-dd'T'HH:mm:ss

If you leave the quotes off your dates, then they will be stored in
the timezone of your local server... with Play assuming the dates were
in YAML with GMT.

- Paul


On Jul 2, 4:49 pm, alotatakada <paulme...@gmail.com> wrote:
> This happened to me as well. I actually didn't want Play to do this
> conversion and have posted here:
>
> http://groups.google.com/group/play-framework/browse_thread/thread/6e...
Reply all
Reply to author
Forward
0 new messages