On Dec 27, 2012, at 8:52 PM, John E. Malmberg <malmb...@encompasserve.org> wrote:
> On 12/24/2012 4:19 PM, Thomas Pfau wrote: >> I wrote a time module that interfaces to the VMS time system services - >> $BINTIM, $ASCTIM, $GETTIM, and $NUMTIM. I also had a replacement routines >> for $ASCTIM, $BINTIM and $GETTIM that could be used on non-VMS platforms. >> >> Currently it accepts and returns VMS time buffers as 8 byte strings but I >> was thinking of allowing numeric values to be passed if perl was built with >> 64 bit integer support. I could detect the input format by using >> SvIOK/SvPOK. The problem I have is determining how the user wants the >> information returned. > > Can you use wantarray? > >> Current interface ($now and $bin are 8 byte strings containing the time): >> $now = gettim(); >> $bin = bintim('01-jan-2010 12:00:00.00'); >> $asc = asctim($bin); >> ($year, $month, $day, $hr, $mn, $sc, $cc) = numtim($bin); >> >> I'm thinking of using an optional additional argument on gettim and bintim >> that would be written with the 8 byte string and have the routines return >> the time as an integer if perl is built with 64 bit integers. I could try >> to interface to the bigint module and return a bigint value if 64 bit >> integers aren't available. > >> Would anyone find this useful? Any comments on the interface? It looks like a good translation into Perl of the native time routines. > > It might be useful. As I posted earlier, I am looking at what it would take > to implement a perl script that could be run detached to keep a VMS directory > synchronized with Dropbox. > > While I have not yet started my investigation, I suspect that I will need to > convert time stamps from the DropBox server to that of the VMS server. These > time stamps might be in Windows format or Linux format, so I would need a way > to convert and compare the timestamps, hopefully with the least loss of > precision. A very long time ago Dan Sugalski posted an example of converting VMS quadword dates into Unix seconds since the epoch: <http://www.xray.mpe.mpg.de/mailing-lists/vmsperl/1998-11/msg00063.html> That gives you the seconds in a a double, which is good enough up until the year 3000 or so. ________________________________________ Craig A. Berry mailto:craigbe...@mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser