Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] CPAN alternatives for time-related functions

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: IKEDA Soji <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] CPAN alternatives for time-related functions
  • Date: Tue, 25 Mar 2014 12:40:26 +0900

Hi,

On Mon, 24 Mar 2014 15:30:57 +0100
Guillaume Rousse <address@concealed> wrote:

> The Sympa::Tools::Time module contains a few time-related functions,
> mostly related to conversion between string and timestamps formats:
> epoch2yyyymmjj_hhmms()
> adate()
> get_midnight_time()
> epoch_conv()
> date_conv()
> duration_conv()

I overlookded these functions.

epoch2yyyymmjj_hhmms() is used only once;
adate() is never used;
get_midnight_time() is used only once.

Former two may be replaced with strftime() (although locale should
be considered).

> parse_date()

Date::Parse::str2time() may be an alternative to
time_utils::parse_date() if it is targetted to Date: header fields.
And anyway nothing is better than the module recently maintained.
I don't stick to this module.


> Those 300 lines of code would easily be replaced by some perl module
> available from CPAN. Here is a list of potential alternatives:
>
> 1) Date::Parse: no dependencies, pure perl, but limited to date string
> conversions (it would not replace duration_conv(), for instance).
>
> 2) Date::Manip: few dependencies, pure perl, no idea about the exact
> coverage
>
> 3) DateTime framework (DateTime, DateTime::Format::Mail, etc...):
> multiple dependencies, native code, but covers practically everything.
>
> They could be potentially others, but I limited myself to the one known
> to be actively maintained nowadays.
>
> That's basically a choice between a lightweight-but-limited vs
> heavywheight-but-complete external dependency. I'd personaly go for
> DateTime framework, which is basically in line with the "let's get rid
> of old environement constraints", but that's a merely a project
> management decision.

Regards,

--- Soji


--
株式会社 コンバージョン セキュリティ&OSSソリューション部 池田荘児
〒231-0004 神奈川県横浜市中区元浜町3-21-2 ヘリオス関内ビル7F
e-mail address@concealed TEL 045-640-3550
http://www.conversion.co.jp/



Archive powered by MHonArc 2.6.19+.

Top of Page