You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Nuutti Kotivuori <na...@iki.fi> on 2002/06/01 16:38:02 UTC

Human date representation and strftime

There is another choice to be made. And that is whether to use
apr_strftime or not.

The problem here is that the windows version of apr_strftime is
currently pretty much limited by what strftime can do on windows.

,----[ Windows strftime documentation ]
| %a Abbreviated weekday name
| %A Full weekday name
| %b Abbreviated month name
| %B Full month name
| %c Date and time representation appropriate for locale
| %d Day of month as decimal number (01 - 31)
| %H Hour in 24-hour format (00 - 23)
| %I Hour in 12-hour format (01 - 12)
| %j Day of year as decimal number (001 - 366)
| %m Month as decimal number (01 - 12)
| %M Minute as decimal number (00 - 59)
| %p Current locale's A.M./P.M. indicator for 12-hour clock
| %S Second as decimal number (00 - 59)
| %U Week of year as decimal number, with Sunday as first day of
|    week (00 - 53)
| %w Weekday as decimal number (0 - 6; Sunday is 0)
| %W Week of year as decimal number, with Monday as first day of
|    week (00 - 53)
| %x Date representation for current locale
| %X Time representation for current locale
| %y Year without century, as decimal number (00 - 99)
| %Y Year with century, as decimal number
| %z
| %Z Time-zone name or abbreviation; no characters if time zone is
|    unknown
| %% Percent sign
`----

In addition, apr_strftime implements a few more.

,----[ apr_strftime extensions for Windows ]
| %C The century number (year/100) as a 2-digit integer. (SU)
| %D Equivalent to %m/%d/%y.(Yecch - for Americans only. Americans
|    should note that in other countries %d/%m/%y is rather
|    common. This means that in international context this format is
|    ambiguous and should not be used.) (SU)
| %r The time in a.m. or p.m. notation. In the POSIX locale this is
|    equivalent to '%I:%M:%S %p'. (SU)
| %T The time in 24-hour notation (%H:%M:%S). (SU)
| %e Like %d, the day of the month as a decimal number, but a
|    leading zero is replaced by a space. (SU)
`----

There's a few restrictions this poses us. The first and foremost
of them is that "%Z" is the only time-zone indicator we have -
and that is text, not a number. I remember many of you being -
like me - against timezone names, as they are ambiguous.

So, either we decide to use the apr_strftime and limit ourselves
to this thing - or we dump that and just use the fields from
apr_time_exp_t. I'd favor the latter.

-- Naked


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Human date representation and strftime

Posted by Nuutti Kotivuori <na...@iki.fi>.
Justin Erenkrantz wrote:
> On Sat, Jun 01, 2002 at 07:38:02PM +0300, Nuutti Kotivuori wrote:
>> There is another choice to be made. And that is whether to use
>> apr_strftime or not.
>> 
>> The problem here is that the windows version of apr_strftime is
>> currently pretty much limited by what strftime can do on windows.
> 
> Why not extend apr_strftime to include the timezone as a numeric
> field?

Well the numeric timezone would indeed be an easy addition for the
windows version. But the problem with that one is that it is a GNU
extension to strftime - so we would have to implement that on every
UNIX without a GNU libc. And currently apr just wraps strftime on
unixes, doing no processing of it's own - so I do not know if it's
wanted to add a GNU extension there.

-- Naked


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Human date representation and strftime

Posted by Justin Erenkrantz <je...@apache.org>.
On Sat, Jun 01, 2002 at 07:38:02PM +0300, Nuutti Kotivuori wrote:
> There is another choice to be made. And that is whether to use
> apr_strftime or not.
> 
> The problem here is that the windows version of apr_strftime is
> currently pretty much limited by what strftime can do on windows.

Why not extend apr_strftime to include the timezone as a numeric
field?  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org