"Wiggins d Anconia" <[EMAIL PROTECTED]> wrote on 05/28/2004 12:37:56 
PM:

> > 
> > 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. 
> > 
> 
> add_delta is probably a method/function in Date::Calc or Date::Manip
> modules. But in this case is probably overkill.
> 
> You can use the built-in functions 'time' and 'localtime' to get the
> desired effect.
> 
> perldoc -f time
> perldoc -f localtime
> 
> 'time' will return the current time, from which you can subtract 60*60
> (60 seconds in each of 60 minutes), which gives 1 hour ago. You can then
> use localtime to retrieve the values for the specific fields you need at
> the calculated time.  Alternatively you could use POSIX::strftime for
> the formatting.
> 
> perldoc POSIX
> 
> HTH,
> 
> http://danconia.org

If I understand what you are saying about subtract 60 seconds in each of 
60 minutes, how will this be able to handle:

        1.  When it is 00:15, because if it is 00:15 I will actually want 
23:15
        2.  I can not just subtract 1 from the date because 010104 needs 
to really be 123104.

If this is not what you are suggesting, let me know.  You might be onto 
something.


This is the part that is confusing me currently.  I am just trying to get 
logical understanding of what I want to do before I start writing the 
code.






________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service._______________________________________________________________

This electronic message contains information from MeadWestvaco
Corporation or subsidiary companies, which may be confidential,
privileged or otherwise protected from disclosure.  The
information is intended to be used solely by the recipient(s)
named.  If you are not an intended recipient, be aware that
any review, disclosure, copying, distribution or use of this
transmission or its contents is prohibited.  If you have
received this transmission in error, please notify MeadWestvaco
immediately at [EMAIL PROTECTED]
_______________________________________________________________________

Reply via email to