Re: hour -1 routine

From: John W. Krahn (krahnj_at_acm.org)
Date: 05/29/04


To: beginners@perl.org
Date: Fri, 28 May 2004 15:31:20 -0700

Anthony J Segelhorst wrote:
>
> I am trying to set up a script that will do the do a current time -1
> routine.
>
> Examples:
>
> Current Time:
> mmddyy:hhss
> 052804:1030
>
> Output:
> 052804:0930
>
> Current Time:
> 052704:0015
>
> Output:
> 052604:23:15
>
> I think the add_delta module is where I need to go, but I have never used
> modules before.

$ perl -e'
use POSIX qw/ strftime /;
my @current_time = localtime time;
my @minus_one_hour = localtime time - 3600;
print strftime( "%m%d%y:%H%M\n", @current_time ),
      strftime( "%m%d%y:%H%M\n", @minus_one_hour );
'
052804:1530
052804:1430

John

-- 
use Perl;
program
fulfillment


Relevant Pages

  • How to get the package, file, and line of a method/function invocant?
    ... I am looking for something like the callerroutine in Perl: ... I am writing a script which needs to be allocated an object containing ...
    (comp.lang.python)
  • Re: stack traces for warnings?
    ... and have created a script that uses the 2 modules. ... I'm already using this in my code; the warnings are comming ... The warnings are not capricious statements from the guts of Perl. ... if your routine requires values to be ...
    (comp.lang.perl.misc)
  • 2005-10-23 [de.comp.lang.perl.cgi] FAQ
    ... Programmiersprache Perl in CGI-Scripten. ... Wo gibt es Dokumentation über Perl und CGI? ... Hilfe zum Programm perldoc kann man mit 'perldoc perldoc' ... Mein Script läuft nicht bei meinem Provider. ...
    (de.comp.lang.perl.cgi)
  • 2005-10-23 [de.comp.lang.perl.cgi] FAQ
    ... Programmiersprache Perl in CGI-Scripten. ... Wo gibt es Dokumentation über Perl und CGI? ... Hilfe zum Programm perldoc kann man mit 'perldoc perldoc' ... Mein Script läuft nicht bei meinem Provider. ...
    (de.comp.lang.perl.cgi)
  • 2005-10-23 [de.comp.lang.perl.cgi] FAQ
    ... Programmiersprache Perl in CGI-Scripten. ... Wo gibt es Dokumentation über Perl und CGI? ... Hilfe zum Programm perldoc kann man mit 'perldoc perldoc' ... Mein Script läuft nicht bei meinem Provider. ...
    (de.comp.lang.perl.cgi)