Copyright Digital Equipment Corp. All rights reserved.
The following example shows how to retrieve the current local
time of the system in the binary OpenVMS format, convert the
OpenVMS format time to a UTC-based binary timestamp (using the
system's TDF), and print an ASCII representation of the binary
timestamp.
/********* start example mkvmslocaltime
*********/
#include <utc.h>
main()
{
char outstring[UTC_MAX_STR_LEN];
struct utc utcTime;
int vmsTime[2];
SYS$GETTIM(vmsTime); /* read current time */
if (utc_mkvmslocaltime(&utcTime,vmsTime)) /* convert the local time */
exit(1); /* vmsTime to UTC using */
/* the system tdf. */
/* convert to ISO ascii*/ utc_asclocaltime(outstring,UTC_MAX_STR_LEN,&utcTime);
/* format and print */ printf("Current time=> %s\n",outstring);
}
/***** end example
*****/