Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do compare dates in Perl?

Tags:

date

perl

I have two dates (parsed using str2time). How can I tell if one is after the other?

like image 837
MCS Avatar asked Jan 19 '09 16:01

MCS


People also ask

Can you compare dates in PostgreSQL?

PostgreSQL compare date is used to compare date between two different dates, which we have used as an input. We can compare the date by using where and between clauses; we can also compare the date using the date_trunc function in PostgreSQL.


1 Answers

str2time returns a "unix time", ie the number of seconds after 1 Jan 1970. So you have two integers, and you can compare them like you compare any other integers.

like image 108
Paul Tomblin Avatar answered Oct 21 '22 01:10

Paul Tomblin