it would be interesting to see a proper comparison of DateTime functionality with Date::Manip; i would be surprised if Date::Manip came off worstOK, lets find a framework for the comparison. I'm very much interested in this.
Here's some suggestions for comparison of results:
Please, anyone, tell me the tasks you use Date::Manip for. From the top post in this thread I assume we want the current time and date in the local time zone, formatted in the locally preferred format.
use Date::Manip; $ENV{TZ} = 'EST'; print UnixDate(ParseDate("today"),"%c"); #use Date::Manip;$ENV{TZ}=;print UnixDate(ParseDate(),) use DateTime; print DateTime->now(time_zone=>'Australia/Melbourne')->strftime("%c"); #use DateTime;print DateTime->now(time_zone=>)->strftime()
| Test | Date::Manip | DateTime | Commend |
| Acurateness of results | 0 | 1 | As evidenced by the post, Date::Manip does not work. |
| Brevity of Code | 1 | 0.9 | |
| Understandability of code | 0.6 | 0.8 | Both have their weaknesses here. They both use the symbol %c, which is not too clear. However in DateTime, we see the command for the %c right next to it, rather than in D:M where the command is back at the start of the line. I also took points off D:M for the use of %ENV. Looking at this snippet in a large script, it wouldn't be too obvious that the two commands were related in any way. |
| 1.6 | 2.7 |
Scoring:
Acurateness of results: 1 if accurate, 0 if inaccurate
Brevity of Code: 1 for the shorter code, once data has been removed. Then the longer gets shorter/longer.
Understandability of code: Value judgement.
Of course, I'm open to any criticism, additions and corrections to my comparison. I'd really like to create a fair comparison of various common tasks. Send me your code and your comparisons. Or just send me your test-in-english and I'll code them both.
In reply to Re: Re: setting TZ causes Date::Manip to report incorrect time
by BigLug
in thread setting TZ causes Date::Manip to report incorrect time
by meonkeys
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |