Re: hour -1 routine
From: John W. Krahn (krahnj_at_acm.org)
Date: 05/29/04
- Next message: John W. Krahn: "Re: A ref too far: assign an array ref to an array ref to a hash element"
- Previous message: Angie Ahl: "A ref too far: assign an array ref to an array ref to a hash element"
- In reply to: Anthony J Segelhorst: "hour -1 routine"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: John W. Krahn: "Re: A ref too far: assign an array ref to an array ref to a hash element"
- Previous message: Angie Ahl: "A ref too far: assign an array ref to an array ref to a hash element"
- In reply to: Anthony J Segelhorst: "hour -1 routine"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|