Issue Details (XML | Word | Printable)

Key: NUCLDAP-53
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Stefan Seelmann
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store LDAP

Calendar storage/retrieval is flawed; timezone not stored so fails with daylight saving time

Created: 16/May/12 12:33 PM   Updated: 16/May/12 12:33 PM
Component/s: Persistence, Queries
Affects Version/s: 2.0.0.release, 2.2.0.m1, 3.0.0.release, 3.1.0.m3
Fix Version/s: None


 Description  « Hide
If a user class has a Calendar field and they create the value while running in UK daylight saving time (BST), this is then stored (as GenerlizedTime). They retrieve the object and it is instantiated in GMT not BST.

An example
Calendar=java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet
=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Isle_of_Man",offset=0,dstSavings=3600000,useDaylight=true,transitions=242,lastRule=java.util.SimpleTimeZone[id=Europe/Isle_of_Man,offset=0,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2012,MONTH=4,WEEK_OF_YEAR=20,WEEK_OF_MONTH=3,DAY_OF_MONTH=16,DAY_OF_YEAR=137,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=11,HOUR_OF_DAY=11,MINUTE=29,SECOND=23,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=3600000]
Stored as generlized time=19700929114620Z

This is then retrieved as generalized time=20120516112923Z
Calendar=java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2012,MONTH=4,WEEK_OF_YEAR=20,WEEK_OF_MONTH=3,DAY_OF_MONTH=16,DAY_OF_YEAR=137,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=11,HOUR_OF_DAY=11,MINUTE=29,SECOND=23,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]

The Calendar TypeConverter stored in datanucleus-core ought to do a better job since it does store timezone code in the string.

Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.