(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_sys, prev: ASCEFC, next: ASCTOID)


ASCTIM - Convert Binary Time to ASCII String


Format:
    timbuf = vms_sys.asctim (timadr [,cvtflg])
Returns:
timbuf
Converted Date and Time as an ASCII string.
Arguments:
timadr
64-bit system time - a Python long integer.
See GENMAN 'Programming', 'special OpenVMS datatypes' for details.
cvtflg
Conversion indicator. Please consult the system services reference manual for details.
Examples:
>>> import vms_sys

>>> vms_sys.asctim ()
'12-AUG-1998 10:32:12.47'

>>> vms_sys.asctim (None)
'12-AUG-1998 10:32:17.69'

>>> vms_sys.asctim (None,0)
'12-AUG-1998 10:32:47.51'

>>> vms_sys.asctim (None,1)
'10:33:01.12'


>>> vms_sys.asctim (0x009A0070B0CB6D60L)
'28-MAR-1996 20:50:41.59'

>>> print 0x009A0070B0CB6D60L
43347630415900000L
>>> vms_sys.asctim (43347630415900000L, 0)
'28-MAR-1996 20:50:41.59'

>>> vms_sys.asctim (0x009A0070B0CB6D60L, 1)
'20:50:41.59'

>>> vms_sys.asctim (0x009A0070B0CB6D60L, None)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: illegal argument type for built-in operation

>>> vms_sys.asctim ('0x009A0070B0CB6D60L', 1)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: timadr - must be long integer

>>> vms_sys.asctim ('string')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: timadr - must be long integer

>>> # this is only an integer, not a long integer
>>> vms_sys.asctim (0x12345)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: timadr - must be long integer

>>> # 'None' for argument 2 is not supported
>>> vms_sys.asctim (None,None)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: illegal argument type for built-in operation
>>>

(go to: table of contents, index, list of vms_sys, prev: ASCEFC, next: ASCTOID)

27-SEP-1998 ZE.