(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_sys, prev: SUSPND, next: TRNLNM)


TIMCON - Time Converter


Converts 128-bit Coordinated Universal Time (UTC) format to 64-bit system format or 64-bit system format to 128-bit UTC format based on the value of the convert flag.

Format:

    utcadr = vms_sys.timcon ([timadr] , cvtflg=1)
    timadr = vms_sys.timcon ([utcadr] , cvtflg=0)
Returns:
timadr
64-bit system time - a Python long integer.
See GENMAN 'Programming', 'special OpenVMS datatypes' for details.
utcadr
128-bit UTC value - a Python long integer.
Arguments:
timadr
64-bit system time - a Python long integer.
See GENMAN 'Programming', 'special OpenVMS datatypes' for details.
utcadr
128-bit UTC value - a Python long integer.
cvtflg
conversion flag indicating the direction of the conversion. If omitted, then the value 0 is used.
Examples:
>>> import vms_sys

>>> o_utctim = vms_sys.getutc ()
>>> print vms_sys.ascutc (o_utctim)
 9-JAN-1999 20:24:31.25
>>> o_utctim
21584378040929278433485881193570887456L
>>>

>>> q_bintim = vms_sys.timcon (o_utctim,0)
>>> print vms_sys.asctim (q_bintim)
 9-JAN-1999 20:24:31.25
>>> q_bintim
44226302712500000L
>>>

>>> q_bintim = vms_sys.gettim ()
>>> print vms_sys.asctim (q_bintim)
 9-JAN-1999 20:25:00.90
>>> q_bintim
44226303009000000L
>>>

>>> o_utctim = vms_sys.timcon (q_bintim,1)
>>> print vms_sys.ascutc (o_utctim)
 9-JAN-1999 20:25:00.90
>>> o_utctim
21584378040929278433485881193867387456L
>>>

>>> q_bintim = vms_sys.gettim ()
>>> print vms_sys.asctim (q_bintim)
 9-JAN-1999 20:25:32.76
>>> q_bintim
44226303327600000L
>>> o_utctim = vms_sys.timcon (q_bintim,99)
>>> print vms_sys.ascutc (o_utctim)
 9-JAN-1999 20:25:32.76
>>> o_utctim
21584378040929278433485881194185987456L
>>>

>>> q_bintim = vms_sys.timcon (None,0)
>>> print vms_sys.asctim (q_bintim)
 9-JAN-1999 20:25:51.49
>>>

>>> q_bintim = vms_sys.timcon ("",0)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: argtim - must be long integer
>>>

>>> o_utctim = vms_sys.timcon (None,1)
>>> print vms_sys.ascutc (o_utctim)
 9-JAN-1999 20:26:14.62
>>>

>>> o_utctim = vms_sys.timcon ("",1)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: argtim - must be long integer
>>>

(go to: table of contents, index, list of vms_sys, prev: SUSPND, next: TRNLNM)

09-JAN-1999 ZE.