Re: Formatting a date/time string



On 12/29/05, Federico Mena Quintero <federico ximian com> wrote:
> Rick Stockton has been looking into adding a Time field to
> GtkFileChooser:
>
> http://bugzilla.gnome.org/show_bug.cgi?id=324543
>
> Nautilus seems to use a plain "%c" format for strftime(), but that seems
> to produce really long strings.
>
> Is there a standard format string that we can use to produce a short
> representation of the date and time?  Or should we just use %c and
> assume that the locale data will be acceptable to the user?

%c poses some usability annoyance since the file dialog will be either very
large, or the date/time part is simply hidden under cover and users have
to scroll horizontally before seeing it.

If short string is more desired, I'd suggest showing only the time if
modification time is within 1 day, and only showing the date if more than
1 day. And use ISO8601 format for date representation as well:
"%Y-%m-%d". This avoids ambiguity. For display of time, perhaps
the seconds part can be removed as well?

And of course, make the string translatable is the best thing to do, since
translators can decide if there are any better date/time representation
for their own language.

Abel

>
> Thanks,
>
>   Federico
>
> _______________________________________________
> gnome-i18n mailing list
> gnome-i18n gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-i18n
>


--
Abel Cheung   (GPG Key: 0xC67186FF)
Key fingerprint: 671C C7AE EFB5 110C D6D1  41EE 4152 E1F1 C671 86FF
--------------------------------------------------------------------
* GNOME Hong Kong - http://www.gnome.hk/
* Opensource Application Knowledge Assoc. - http://oaka.org/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]