Sombrerero_loco has asked for the wisdom of the Perl Monks concerning the following question:
But i dont know how i can use this time module:my $sql1_datos = qq(select contador, cod_entidad_oim, cod_agr, cod_ope +racion from mapcom_portext.TR0685002 where fch_hor_operacion between + to_date(\'$now\','dd-mon-yyyy') and to_date(\'$1hourago\','dd-mon-yy +yy'));
I need to do always a query where $now its equal to the current time in format DD/MM/YYYY HH24:MM:SS... and $1hourago must be $now - 1 hour.... This its where i dont know how i can tell perl to from the (for example) $now = 09/01/2009 15:00:00 rest 1 hour and use its as $1hourago.... Any ideas? maybe transforming it to time var, resting 3600 seconds and convert it again to the desiree format? Thanks! :::When you dream, there're no rules, ppl can fly...anything can happen!!!:::use POSIX 'strftime'; $now = lc strftime("%d/%m/%y %H:%M:%S", localtime);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question about perl & oracle & and a SQL query
by 1Nf3 (Pilgrim) on Feb 09, 2009 at 14:18 UTC | |
by Sombrerero_loco (Beadle) on Feb 09, 2009 at 14:23 UTC | |
|
Re: Question about perl & oracle & and a SQL query
by roboticus (Chancellor) on Feb 09, 2009 at 14:22 UTC | |
by jhourcle (Prior) on Feb 09, 2009 at 18:18 UTC | |
by Sombrerero_loco (Beadle) on Feb 09, 2009 at 14:25 UTC | |
by massa (Hermit) on Feb 09, 2009 at 15:35 UTC | |
by Sombrerero_loco (Beadle) on Feb 10, 2009 at 14:57 UTC | |
by maxodyne (Initiate) on Mar 03, 2011 at 16:35 UTC | |
|
Re: Question about perl & oracle & and a SQL query
by ww (Archbishop) on Feb 09, 2009 at 14:20 UTC |