Re: [PATCH 1/2] gitweb: rename parse_date() to format_date()

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

 



Kevin Cernekee <cernekee@xxxxxxxxx> writes:

> One might reasonably expect a function named parse_date() to be used
> for something along these lines:
>
> $unix_time_t = parse_date("2011-03-19");
>
> But instead, gitweb's parse_date works more like:
>
> &parse_date(1300505805) = {
>         'hour' => 3,
>         'minute' => 36,
>         ...
>         'rfc2822' => 'Sat, 19 Mar 2011 03:36:45 +0000',
>         ...
> }
>
> Rename the function to improve clarity.  No change to functionality.

Except for a small detail that the function also takes the "-0800"
timezone string, I think this is a good change.

The word "parse" makes the readers expect that its input is something
"format" would have produced for use by others (often humans, but there
are functions that parse xml ;-).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]