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

Uwe Schindler commented on LUCENE-6564:
---------------------------------------

There is also another possibility to get milliseconds without a date format: 
[http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/FileTime.html#toString()]:

{code:java}
FileTime.fromMillies(...).toString()
{code}

(this is new since Java 7 and somehow "misuses" the FileTime API, but it might 
be useful here. It also uses UTC and uses the generic ISO8601 format!

The other possibility is using a ThreadLocal:

{code:java}
static final ThreadLocal<DateFormat> FORMAT = ThreadLocal.withInitial(() -> new 
SimpleDateFormat(..., Locale, Timezone));
{code}

> Normalize date format for IW in unit tests
> ------------------------------------------
>
>                 Key: LUCENE-6564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6564
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Ramkumar Aiyengar
>            Assignee: Ramkumar Aiyengar
>            Priority: Minor
>             Fix For: 5.3
>
>         Attachments: LUCENE-6564.patch, LUCENE-6564.patch
>
>
> Noticed while debugging some IW output in an unit test that milliseconds were 
> not output in the date, changed this to reuse the date format used by 
> {{PrintStreamInfoStream}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to