Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: Epoch time

Original Message
Name: amsedelm
Date: February 6, 2008 at 12:51:25 Pacific
Subject: Epoch time
OS: OpenVMS V7.3-2
CPU/Ram: 4/16GB
Model/Manufacturer: HP/ES 45
Comment:
Does anyone have a script that converts standard VMS time to epoch time? I'm writing a timestamp synchronizing script and it's easier to use epoch time to do the calculations.
Thanks.
Mike

Report Offensive Message For Removal

Response Number 1
Name: Bob Gezelter
Date: February 6, 2008 at 17:12:37 Pacific
Subject: Epoch time
Reply: (edit)
Mike,

If you mean the actual binary OpenVMS time, then the operative question is what language are you writing in?

If you are working in DCL, what version of OpenVMS are you running? 7.3-2 has F$DELTA_TIME.

In all of the non-DCL languages, there are calls that will return the actual 64-bit binary time.

- Bob Gezelter, http://www.rlgsc.com


Report Offensive Follow Up For Removal

Response Number 2
Name: Joseph.Huber
Date: February 7, 2008 at 01:21:46 Pacific
Subject: Epoch time
Reply: (edit)
Well if the epoch means "Unix epoch time" time_t, then You may look into an example posted in comp.os.vms some years ago:

http://wwwvms.mppmu.mpg.de/vmssig/s...


Report Offensive Follow Up For Removal

Response Number 3
Name: Joseph.Huber
Date: February 7, 2008 at 02:20:29 Pacific
Subject: Epoch time
Reply: (edit)
In a quick exercise I made a library routine from the above example program, which takes an input VMS quadword time, and returns the epoch:

http://wwwvms.mppmu.mpg.de/~huber/u...

If needed in a DCL script, You can easily build a program taking the VMS time string from the command-line, using the above routine to get epoch, put that into a DCL symbol (decimal until 2035, or better hexadezimal :-), so You can use it in the DCL procedure.



Report Offensive Follow Up For Removal

Response Number 4
Name: amsedelm
Date: February 7, 2008 at 05:50:15 Pacific
Subject: Epoch time
Reply: (edit)
Yes, DCL. Sorry, still a newbie. I try to translate my Unix scripts to DCL and sometimes I get stumped. I have an epoch time calculator script that I've been trying to comnvert to DCL, but I'm having a rough time.
Thanks for all your ideas.

Michael Ledesma
System Administrator
Petro Heating Oil Svc's


Report Offensive Follow Up For Removal

Response Number 5
Name: Bob Gezelter
Date: February 7, 2008 at 07:55:52 Pacific
Subject: Epoch time
Reply: (edit)
Mike,

First question: What version of OpenVMS is running on your system? As I mentioned, F$DELTA_TIME does a large part of what is wanted, without any fuss. However, it is a relatively new lexical function (I have not checked exhaustively, but it was introduced sometime between 7.0 and 7.3-2).

If you are running a version that supports F$DELTA_TIME, you can create a "date since epoch" by doing a delta time from the epochal date (so long as it is past the OpenVMS epochal date of 17 November 1858; see the System Services reference manual for the date format). The datetime can be converted into a easily processed form using the F$CVTIME lexical function.

- Bob Gezelter, http://www.rlgsc.com


Report Offensive Follow Up For Removal

Response Number 6
Name: amsedelm
Date: February 7, 2008 at 08:15:10 Pacific
Subject: Epoch time
Reply: (edit)
Hey, Bob.
We're running OpenVMS V7.3-2 , so it should work. I'll look into it immediately.
Thanks a bunch!
Mike

Michael Ledesma
System Administrator
Petro Heating Oil Svc's


Report Offensive Follow Up For Removal

Response Number 7
Name: Bob Gezelter
Date: February 7, 2008 at 08:32:16 Pacific
Subject: Epoch time
Reply: (edit)
Mike,

My pleasure. It was nothing.

If we can be of additional assistance, please feel free to contact me, either in the forum, or privately.

- Bob Gezelter, http://www.rlgsc.com


Report Offensive Follow Up For Removal

Response Number 8
Name: HakZan
Date: February 7, 2008 at 10:29:41 Pacific
Subject: Epoch time
Reply: (edit)
Bob, ( & Mike )

F$DELTA_TIME() has its limitations.
OpenVMS has only four digits for the number of days in a delta-time.

9999 days is roughly 27 years.

But you will get a

%SYSTEM-F-IVTIME, invalid time

if you are ouside the boundary.
Not a userfriendly errormessage....

regards,

Hakan Zanderau


Report Offensive Follow Up For Removal

Response Number 9
Name: Bob Gezelter
Date: February 7, 2008 at 11:36:04 Pacific
Subject: Epoch time
Reply: (edit)
Hakan,

If you have a support contract, I suggest that you submit that comment to the appropriate channels (or bring it to the attention of the engineering group in some other fashion).

This is not a problem with the underlying format, it is an issue with the conversion routine to/from ASCII. The underlying format of the information is the 64-bit time/date binary, with the unit being microforthnights.

- Bob Gezelter, http://www.rlgsc.com


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Epoch time

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC