For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > July 2005 > comparing two dates









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author comparing two dates
Alexandre Jaquet

2005-07-29, 9:04 am

HI,

Anyone know how to compare two dates with time. I have a datetime field
in my db and want to compare it with current date time.


($ARTICLE{'counter'},$ARTICLE{'enchere_d
ate_fin'})=sqlSelect("nbr_enchere,enchere_date_fin",
"article", "id_article = '$article'");
$ARTICLE{'counter'} += 1;

local our $sec,$min,$hour,$mday,$mon,$year,$wday,$
yday,$isdst)=localtime();
local our $date = sprintf "%4d-%02d-%02d",$year+1900,$mon+1,$mday;
local our $time = sprintf("%4d:%02d:%02d",$hour,$min,$sec);
#current date time $date $time

thanks
Paul Lalli

2005-07-29, 9:04 am

Alexandre Jaquet wrote:
> Anyone know how to compare two dates with time. I have a datetime field
> in my db and want to compare it with current date time.


I seem to recall this question being asked about three days ago.
Please use Google's archive to search this group for the word "date" or
"compare", and order your results by date.

Paul Lalli

T W Hu

2005-07-29, 9:04 am

> Anyone know how to compare two dates with time. I have a datetime field
> in my db and want to compare it with current date time.

[snip]
Date::Calc
Delta_Days, Delta_DHMS, etc


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com