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
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.
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
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.
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.