To nick some pits....
On Fri, 11 Aug 2000, Nathan Wiger wrote:
> Here is the justification. As most people write dates, they write
> something like this:
>
> 1/20/1976 2:34:02
> 4/5/981 11:05:09
>
> Very few people I've met write dates like this habitually in the real
> world:
>
> 01/20/1976 02:34:02
> 04/05/0981 11:05:09
>
> And I've never seen anyone write this:
>
> 1/20/1976 2:34:2
> 4/5/981 11:5:9
>
> Notice that the hours/mins are always padded but the rest isn't.
I think you meant minutes/seconds.
>
> If you're writing a program that uses the date as an actual date (and
> not as a file suffix, for example), you'll probably want to present what
> people are used to seeing, in this case the first one. And if you want a
s/people/your audience/;
> file suffix, use what I suggested in the RFC:
>
> $backup_suffix = date time, '%Y%m%d%H%M%S';
>
> Which would return something like "20001104120309".
>
> I've gone back and forth about this. I ultimately think that the above
> approach will end up with date() being more usable in more situations,
> even though it seems a little inconsistent. I think it returns what
> people want, it's just that people are inconsistent.
I would say that various pockets of people are inconsistent with other
pockets.
>
> Remember, localtime is already a very consistent interface from a lot of
> aspects, but it is horribly unusable because it doesn't return stuff in
> the form you want it.
Nothing returns stuff in the form I want. That's why I use Perl. ;-)
As long as this transformation remains simple, and the strftime
interface is simple enough, I don't care what the interface is.
Although, (and this may have already been
mentioned/suggested/accepted/rejected),
if you're going to have an object interface, perhaps the constructor
can take the strftime string for use as the default scalar output?
--
Bryan C. Warnock
([EMAIL PROTECTED])