Click here to get back home

FAQ 4.14 How can I compare two dates and find the difference?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
FAQ 4.14 How can I compare two dates and find the difference? PerlFAQ Server 05-12-2008
Posted by PerlFAQ Server on May 12, 2008, 3:03 am
Please log in for more thread options
This is an excerpt from the latest version perlfaq4.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

4.14: How can I compare two dates and find the difference?

(contributed by brian d foy)

You could just store all your dates as a number and then subtract. Life
isn't always that simple though. If you want to work with formatted
dates, the "Date::Manip", "Date::Calc", or "DateTime" modules can help
you.



--------------------------------------------------------------------

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.

Posted by Philluminati on May 12, 2008, 5:41 am
Please log in for more thread options
> This is an excerpt from the latest version perlfaq4.pod, which
> comes with the standard Perl distribution. These postings aim to
> reduce the number of repeated questions as well as allow the community
> to review and update the answers. The latest version of the complete
> perlfaq is athttp://faq.perl.org.
>
> --------------------------------------------------------------------
>
> 4.14: How can I compare two dates and find the difference?
>
> (contributed by brian d foy)
>
> You could just store all your dates as a number and then subtract. Life
> isn't always that simple though. If you want to work with formatted
> dates, the "Date::Manip", "Date::Calc", or "DateTime" modules can help
> you.
>
> --------------------------------------------------------------------
>
> The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
> are not necessarily experts in every domain where Perl might show up,
> so please include as much information as possible and relevant in any
> corrections. The perlfaq-workers also don't have access to every
> operating system or platform, so please include relevant details for
> corrections to examples that do not work on particular platforms.
> Working code is greatly appreciated.
>
> If you'd like to help maintain the perlfaq, see the details in
> perlfaq.pod.

Honestly, what is the point of posting this? It really doesn't help.
It makes the newsgroup harder to read and they are never relevant.
It's basically spam. If the person doesn't google the question before
posting then they sure as hell aren't going to search the group. So
unless the correct answer to the question is on the groups active
discussion page, it really is a waste of space and bandwidth.

Posted by RedGrittyBrick on May 12, 2008, 6:40 am
Please log in for more thread options
Philluminati wrote:
>>
>> These postings aim to
>> reduce the number of repeated questions as well as allow the community
>> to review and update the answers. The latest version of the complete
>> perlfaq is athttp://faq.perl.org.
>
> Honestly, what is the point of posting this?

I may be wrong but I think the point is described in the part you quoted.


> It makes the newsgroup harder to read ...

Have you considered using a newsreader instead of Google Groups. Then
you can kill postings with subjects that start "FAQ ".

--
RGB

Posted by Philluminati on May 12, 2008, 8:24 am
Please log in for more thread options
wrote:
> Philluminati wrote:
>
> >> These postings aim to
> >> reduce the number of repeated questions as well as allow the community
> >> to review and update the answers. The latest version of the complete
> >> perlfaq is athttp://faq.perl.org.
>
> > Honestly, what is the point of posting this?
>
> I may be wrong but I think the point is described in the part you quoted.
>
> > It makes the newsgroup harder to read ...
>
> Have you considered using a newsreader instead of Google Groups. Then
> you can kill postings with subjects that start "FAQ ".
>
> --
> RGB

It doesn't matter what reader I use. It is useless junk that is a
waste of bandwidth. End of story.

Posted by A. Sinan Unur on May 12, 2008, 8:42 am
Please log in for more thread options

>> This is an excerpt from the latest version perlfaq4.pod, which
>> comes with the standard Perl distribution. These postings aim to
>> reduce the number of repeated questions as well as allow the
>> community to review and update the answers. The latest version of the
>> complete perlfaq is athttp://faq.perl.org.
>>
...

> Honestly, what is the point of posting this?

Advertising the FAQ list.

> It really doesn't help.

These postings work in many ways. First, by making specific FAQ entries
more visible to inexperienced users. Second, FAQ entries are constantly
improved using feedback from the group.

> It makes the newsgroup harder to read

No they don't. Certainly, no more than newbies who post without reading
the documentation.

> and they are never relevant.

Huh? They are answers to Perl FAQ list.

> It's basically spam.

You need to learn what spam means.

> If the person doesn't google the question before
> posting then they sure as hell aren't going to search the group.

While I pride myself in reading the full FAQ list every time I upgrade
Perl, I cannot keep it all in my head all the time. These postings have
time and again attracted my attention to useful FAQ entries I had
forgotten. They also serve as an automatic review mechanism meaning that
the quality of the FAQ list increases as a direct result.

So, clueless newbies are not the only potential beneficiaries of these
postings.

Now, please do yourself and us a solid and please refrain from further
troll-like behavior.

Sinan

--
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/

Similar ThreadsPosted
FAQ 4.14: How can I compare two dates and find the difference? December 30, 2004, 6:03 am
FAQ 4.14 How can I compare two dates and find the difference? March 2, 2005, 6:03 am
FAQ 4.14 How can I compare two dates and find the difference? May 6, 2005, 11:03 am
FAQ 4.14 How can I compare two dates and find the difference? July 22, 2005, 10:03 am
FAQ 4.14 How can I compare two dates and find the difference? August 22, 2005, 10:03 am
FAQ 4.14 How can I compare two dates and find the difference? February 17, 2006, 6:03 pm
FAQ 4.14 How can I compare two dates and find the difference? February 23, 2006, 6:03 am
FAQ 4.14 How can I compare two dates and find the difference? April 12, 2006, 9:03 am
FAQ 4.14 How can I compare two dates and find the difference? May 25, 2006, 9:03 am
FAQ 4.14 How can I compare two dates and find the difference? June 26, 2006, 3:03 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap