[ 
https://issues.apache.org/jira/browse/KARAF-6125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16758059#comment-16758059
 ] 

ASF subversion and git services commented on KARAF-6125:
--------------------------------------------------------

Commit f53e3e636a9bc026d0c1b54dd93e5431bb9f3c1d in karaf's branch 
refs/heads/master from Mike Mansell
[ https://gitbox.apache.org/repos/asf?p=karaf.git;h=f53e3e6 ]

[KARAF-6125] Standardized timezone handling for audit dates

Fixed a couple of cases where the FastDateFormat was not using a consistent 
timezone (sometimes provided and sometimes the default). This also required 
fixing a couple of callers of the FastDateFormat, which was mostly related to 
tests.
This bug caused audit file names to sometimes incorrectly roll between days 
depending on the timezone of the user.


> Audit library creates incorrect dates due to timezones
> ------------------------------------------------------
>
>                 Key: KARAF-6125
>                 URL: https://issues.apache.org/jira/browse/KARAF-6125
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.2.2
>            Reporter: Mike Mansell
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>              Labels: audit
>             Fix For: 4.2.3
>
>
> The audit library leverages the FastDateFormat class to generate file names 
> based on the current date. Unfortunately, in some cases, it correctly uses 
> the timezone and in others, it just uses the default timezone.
> To make matters worse, the test cases attempted to work in all scenarios by 
> picked a fixed timezone of GMT+01:00, but with the scenarios where the 
> timezone wasn't used, it could fail if the current timezone was greater than 
> earlier 7 hours than GMT. 
> This was due to the fact that the test cases picked a fixed time of Nov 17th 
> at 7 am. When that was converted to a file name with the format MMM-dd2 (ie. 
> Nov-17). In the couple of cases where the timezone wasn't properly used, it 
> defaulted to the current locale, which if you where greater than - 7 hours 
> (ie. Vancouver which is - 8 hours), then the resulting file name would be 
> Nov-16, and thus the test cases would fail.
> I'll issue a PR tomorrow that consistently uses the timezone both in the test 
> cases and within the core Audit code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to