(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_lib, prev: CVT_TO_INTERNAL_TIME, next: DATE_TIME)


CVT_VECTIM - Convert 7-Word Vector to Internal Time


Format:
    resultant_time = vms_lib.cvt_vectim (input_time)
Returns:
resultant_time
64-bit system time - a Python 'long integer'.
See GENMAN 'Programming', 'special OpenVMS datatypes' for details.
Arguments:
input_time
a tuple that consists of:
(year, month, day, hour, minute, second, hundredth)
Examples:
>>> import vms_lib

>>> input_time = (2000, 2, 29, 12, 34, 56, 78)
>>> resultant_time = vms_lib.cvt_vectim (input_time)
>>> print resultant_time
44585444967800000L
>>> import vms_sys
>>> print vms_sys.asctim (resultant_time)
29-FEB-2000 12:34:56.78

>>> resultant_time = vms_lib.cvt_vectim ((2000, 2, 29, 12, 34, 56, 78))
>>> print vms_sys.asctim (resultant_time)
29-FEB-2000 12:34:56.78

>>> # a tuple is required as argument 1 - not seven arguments
>>> resultant_time = vms_lib.cvt_vectim (2000, 2, 29, 12, 34, 56, 78)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: function requires exactly 1 argument; 7 given
>>>

>>> # wrong order of arguments
>>> input_time = (78,56,34,12,29,2,2000)
>>> resultant_time = vms_lib.cvt_vectim (input_time)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_lib.error: (1410012, '%LIB-F-IVTIME, invalid time passed in,\
 or computed')
>>>

>>> # tuple too small                     #1,  #2, #3, #4, #5, #6 7?
>>> resultant_time = vms_lib.cvt_vectim ((2000, 2, 29, 12, 34, 56))
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: must be a tuple of 7 integers
>>>

>>> # The first tuple element is numbered 0.
>>> # tuple element 2 out of range --------------vvvvv
>>> resultant_time = vms_lib.cvt_vectim ((2000,2,65536,12,34,56,78))
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 2: tuple-element:2 is not a 16-bit integer
>>>

>>> # The first tuple element is numbered 0.
>>> # tuple element 1 is invalid ---------------v
>>> resultant_time = vms_lib.cvt_vectim ((2000,'X',29,12,34,56,78))
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: tuple-element:1 is not an integer
>>>

(go to: table of contents, index, list of vms_lib, prev: CVT_TO_INTERNAL_TIME, next: DATE_TIME)

31-MAR-1999 ZE.