incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Jaquith (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601
Date Fri, 22 Feb 2008 22:09:19 GMT

    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571615#action_12571615
] 

Andrew Jaquith commented on JSPWIKI-196:
----------------------------------------

I think we need to focus this discussion a little. There are two issues here, I think:
- How DateTimes are *stored* internally, for example as page metadata 
- How they are *rendered* to end-users in their browsers

It isn't obvious to me which of these two issue this bug is about. I'd recommend that the
committers (or the bug author) re-title this bug to make it more precise.

That said, it seems to me that the right strategy is to always store DateTimes in a neutral
format (ISO 8601 is fine with me), but make sure that components that render text for end-users
use formats suitable for the browser's locale.

On that latter point (rendering), the best way to display dates appropriately is to determine
the correct Locale via HttpServletRequest.getLocale(). Rendering components, therefore, should
make sure they obtain this locale. By the way, in JSPWiki 3.0 we will have a nice, reliable
way to make sure that the request always has the correct Locale (courtesy of Stripes), so
this technique should be quite future-proof.

If everyone agrees with this approach, then the next step is to start identifying precise
places where we deviate from it. Specific cases where we've deviated (date storage v. date
rendering) should all be filed as separate bugs.

> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions
(page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default.
The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show
time with the precision to the second, as the SI unit system defines the second as the basic
unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second
(s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to
decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even
be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20
22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it
is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message