- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Calculating delta time in a CP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 07:11 PM
тАО07-19-2004 07:11 PM
Can you give me an idea on how to calculate a delta time in order to use it in a delete/before command, so it will delete files older than X days?
I can get the current time using f$time() lexical, but what next?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 07:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 07:33 PM
тАО07-19-2004 07:33 PM
Re: Calculating delta time in a CP
To compute the same date you can use the lexical function f$cvtime.
$ date = f$cvtime("today-7-00:00","ABSOLUTE")
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 07:37 PM
тАО07-19-2004 07:37 PM
Re: Calculating delta time in a CP
It works like a charm.
Thanks a-lot.
Alon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 08:00 PM
тАО07-19-2004 08:00 PM
Re: Calculating delta time in a CP
"today-7-00:00" is not a delta time - it is a 'combination time'.
$ write sys$output f$time()," ",f$cvtime("today-7-00:00","absolute")
20-JUL-2004 10:00:37.85 13-JUL-2004 00:00:00.00
"-7-00:00" is not a delta time, either - it is still a combination time meaning 'now - 7 days'.
$ write sys$output f$time()," ",f$cvtime("-7-00:00","absolute")
20-JUL-2004 10:00:41.08 13-JUL-2004 10:00:41.08
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2004 09:39 AM
тАО07-21-2004 09:39 AM
Re: Calculating delta time in a CP
As pointed out, a combination time will do what you want.
But for those interested in "true" delta times, DCL is missing the ability to find the difference between two absolute times.
No promises, but I think delta time calculations in DCL have been implemented for an upcoming version.
In the mean time, you can use combination times to calculate the difference between two delta times, T0 and T1, by successive approximation. The idea is to find time D such that T0+D = T1. Unfortunately because of the "key space" of times, a true binary search isn't worth the effort. Instead this algorithm works its way down the fields. Being an iterative, it's not exceptionally fast. Maximum difference is 10,000 days (~27 years).
You could always write a program to do this. I'm not sure if the cost of an image activation is greater than all that looping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2004 11:16 AM
тАО07-21-2004 11:16 AM
Re: Calculating delta time in a CP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2004 01:14 PM
тАО07-21-2004 01:14 PM
Re: Calculating delta time in a CP
to quote Guy Peleg from comp.os.vms
In the technical update day in the Netherlands it was mentioned that it
is hard to do delta time calculations.
In VMS V7.3-2 we added new lexical function F$DELTA_TIME. See the
following example:
BLUSKY> a=f$time()
BLUSKY> b=f$time()
BLUSKY> sh sym a
A = " 3-OCT-2003 17:39:58.54"
BLUSKY> sh sym b
B = " 3-OCT-2003 17:40:23.22"
BLUSKY> write sys$output f$delta(a,b)
0 00:00:24.68
hp has it now(TM), John ;-)
Greetings, Martin