On 19-Dec-2010 17:14, Dominique Pellé wrote:
> Bram Moolenaar wrote:
> 
>> Thanks.  I think we also need to explain the date format.  How about
>> this:
>>
>>                        The "when" column is the date and time when this
>>                        change was made.  The four possible formats are:
>>                            N seconds ago
>>                            HH:MM:SS             hour, minute, seconds
>>                            MM/DD HH:MM:SS       idem, with month and day
>>                            YYYY/MM/DD HH:MM:SS  idem, with year
>>
>> And to reflect that in the example:
>>
>>                           number changes  when               saved ~
>>                               88      88  2010/01/04 14:25:53
>>                              108     107  08/07 12:47:51
>>                              136      46  13:33:01             7
>>                              166     164  3 seconds ago
>>
>> First one to actually get the year to show up gets a lolly :-).
> 
> That's better indeed.
> 
> One correction though: in source vim/src/undo.c:2887, I see
> that the format when file is older than ~6 months is:
>   "%y/%m/%d %H:%M:%S".
> 
> According to "man strftime", %y is the year _without_ the
> century (i.e. range 00 to 99). So help file should say
> YY/MM/DD HH:MM:SS rather than YYYY/MM/DD HH:MM:SS.
> 
> Or perhaps it's better to use format %Y rather than %y in
> undo.c:2887 to show a 4 digits date. Who knows, someone
> might thank you for that in 100 years.

Please forgive my ignorance; I don't know much about the Vim sources yet. But
I'm wondering why the date format is hard-coded (to some US-English format) at
all. Shouldn't something like %c / %X be used, so that the format is determined
by the user's locale? Our international users will thank us for that.

The only downside would be that the MM/DD "middle" option wouldn't be easily
available (well, one could somehow substitute away the year from the full
format), and that parsing of the command's output in scripts would be more
complex. (I assume that scripts would temporarily do :lang time C to get a fixed
format, and then restore the user's setting.)

-- regards, ingo

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui