VMS Help  —  Lexicals  F$CVTIME  Examples
    1.$ TIME = F$TIME()
      $ SHOW SYMBOL TIME
        TIME = "14-DEC-2002 10:56:23.10"
      $ TIME = F$CVTIME(TIME)
      $ SHOW SYMBOL TIME
        TIME = "2002-12-14 10:56:23.10"

      This example uses the F$TIME function to return the system
      time as a character string and to assign the time to the symbol
      TIME. Then the F$CVTIME function is used to convert the system
      time to an alternate time format. Note that you do not need to
      place quotation marks (" ")  around the argument TIME because
      it is a symbol. Symbols are automatically evaluated when they
      are used as arguments for lexical functions.

      You can use the resultant string to compare two dates (using
      .LTS. and .GTS. operators). For example, you can use F$CVTIME
      to convert two time strings and store the results in the
      symbols TIME_1 and TIME_2. You can compare the two values,
      and branch to a label, based on the following results:

          $ IF TIME_1 .LTS. TIME_2 THEN GOTO FIRST

    2.$ NEXT = F$CVTIME("TOMORROW",,"WEEKDAY")
      $ SHOW SYMBOL NEXT
       NEXT = "Tuesday"

      In this example, F$CVTIME returns the weekday that corresponds
      to the absolute time keyword "TOMORROW". You must enclose the
      arguments "TOMORROW" and "WEEKDAY" in quotation marks because
      they are character string expressions. Also, you must include a
      comma as a placeholder for the output_time_format argument that
      is omitted.

    3.$ SHOW TIME
        27-MAR-2002 09:50:31
      $ WRITE SYS$OUTPUT F$CVTIME(,,"DAYOFYEAR")
      86
      $ WRITE SYS$OUTPUT F$CVTIME(,,"HOUROFYEAR")
      2049
      $ WRITE SYS$OUTPUT F$CVTIME(,,"MINUTEOFYEAR")
      122991
      $ WRITE SYS$OUTPUT F$CVTIME(,,"SECONDOFYEAR")
      7379476

      In this example, F$CVTIME returns the values for the
      following keywords: DAYOFYEAR, HOUROFYEAR, MINUTEOFYEAR, and
      SECONDOFYEAR.
Close Help