This is my first script in PERL. Hence require your help in moving further.
I have a script which should populate the values for Today, Yesterday output.
For which I use timeFrame as a variable to obtain the time in hrs:mm as 10:00.
All I want is, I want my timeFrame to start with 00:00 and end with with my current timestamp. Say if the time is 07:23, my timeFrame should contain 00:00 to 07:00. [I am not bothered on Minutes since it works hourly basis]. I have written the PERL in the below way.
But the output came as
Quote:
TimeFrame -> 19:00 StartTime -> 2 StartHour -> 19
TimeFrame -> 20:00 StartTime -> 2 StartHour -> 20
TimeFrame -> 21:00 StartTime -> 2 StartHour -> 21
TimeFrame -> 22:00 StartTime -> 2 StartHour -> 22
TimeFrame -> 23:00 StartTime -> 2 StartHour -> 23
TimeFrame -> 00:00 StartTime -> 2 StartHour -> 00
TimeFrame -> 01:00 StartTime -> 2 StartHour -> 01
TimeFrame -> 02:00 StartTime -> 2 StartHour -> 02
TimeFrame -> 03:00 StartTime -> 2 StartHour -> 03
TimeFrame -> 04:00 StartTime -> 2 StartHour -> 04
TimeFrame -> 05:00 StartTime -> 2 StartHour -> 05
TimeFrame -> 06:00 StartTime -> 2 StartHour -> 06
TimeFrame -> 07:00 StartTime -> 2 StartHour -> 07
Now the current time is 07:23, so I want that output to be like below
Quote:
TimeFrame -> 00:00 StartTime -> 2 StartHour -> 00
TimeFrame -> 01:00 StartTime -> 2 StartHour -> 01
TimeFrame -> 02:00 StartTime -> 2 StartHour -> 02
TimeFrame -> 03:00 StartTime -> 2 StartHour -> 03
TimeFrame -> 04:00 StartTime -> 2 StartHour -> 04
TimeFrame -> 05:00 StartTime -> 2 StartHour -> 05
TimeFrame -> 06:00 StartTime -> 2 StartHour -> 06
TimeFrame -> 07:00 StartTime -> 2 StartHour -> 07
Can you please help me by correcting this code. It will be great if you make use of localtime and not anything else. Thanks in advance.
I am in a hurry, please help me asap. TA.
---------- Post updated 10-05-12 at 03:37 AM ---------- Previous update was 10-04-12 at 06:57 AM ----------
Hey all,
When you run the 'ls -la' command it'll show you the time and dates of all files/directories. Now what I am trying to do is create a script that will tell me what files haven't been used in over the past 1 month and what the time and date is that the files that haven't been accessed in... (2 Replies)
Hi All,
I have some files which are creates every day using a script. I want to create a log files which does write "filename,creation day and time"
how can I do this ??
Alice (3 Replies)
:confused: I'm not really sure about the default backup date & time in our Unix system and I would like to change it to a convienient time...how do I do that? Please help? (1 Reply)
Hi,
I am facing a weird problem with the 'Date'. If I check date multiple times in a short interval I see a different time altogether. Here is an example
$ date
Tue Jul 15 02:07:22 PDT 2008
$ date
Tue Jul 15 02:07:23 PDT 2008
$ date
Tue Jul 15 03:20:42 PDT 2008
$ date
Tue Jul 15... (5 Replies)
Hi guys,
I know that this topic has been discuss numerous times, and I have search the net and this forum for it.
However, non able to address the problem I faced so far.
I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Hi,
i dont have remote m/c user credential. i only know remote m/c ip address. and i am able to ping that remote m/c.
In windows we use: "net time \\computername" to get the remote m/c time.
so how can i get remote m/c time in unix m/c? (means a unix command)
Thanks for the help.
... (9 Replies)
Hello All,
I was having a look on threads on the Forum about time calculation but didn't find exactly this issue.
For instance, if we have these 2 dates, begin & end :
20100430235830
20100501000200
Is there anyway, awk, ksh, perl to calculate the difference in sec and get for... (6 Replies)
Hi,
I am having a file name as exp_bkp_tables_18_Oct_2010_10_50_28.dmp which is used for import the records.
Now, I want to print the output using the selected file name as below :
Table records will get restored as on date 18-Oct-2010 and time 10:50:28
How it can be done ?
With... (5 Replies)