Skip to main content

Time functions

In the time function descriptions, text-type data refers to data in HH:MM:SS format with two digits for hours, two digits for minutes, and two digits for seconds separated by colons. Time-type data refers to six-digit data containing two digits each for hours, minutes, and seconds in HHMMSS format.

Restriction

  • Parameters in time functions are generally required to be specified as time-type data in six-digit HHMMSS format. If four-digit data such as HHMM or MMSS format is specified for a function that expects time-type data as a parameter, an internal error will occur and the correct value cannot be retrieved.

  • To use text-type data in the time-type data parameter of a time function, the data type must be converted using CTOT.

Function name

Feature

TTOC

Converts time-type data (HHMMSS) into text-type data (HH:MM:SS).

TIME

Retrieves the system time.

ITIME

Retrieves the system time.

CTOT

Converts text-type data (HH:MM:SS) into time-type data (HHMMSS).

HOUR

Retrieves only hours (HH) as numeric-type data from time-type data (HHMMSS).

MINT

Retrieves only minutes (MM) as numeric-type data from time-type data (HHMMSS).

SEC

Retrieves only seconds (SS) as numeric-type data from time-type data (HHMMSS).

TTOC

Feature

Converts time-type data (HHMMSS) into text-type data (HH:MM:SS).

Format

TTOC(time_data)

Settings

  1. In "time_data", specify the time-type data/text-type data to convert, or the name of the field that contains the data.

  2. This will convert "time_data" to text-type data.

Caution

The argument should be data from 000000 to 235959.

Usage examples

Prerequisite

When time data "203040" is entered in the text-type field "S1"

  • Example 1: When converting time-type data from the field "S1" to text-type data in "HH:MM:SS" format, and printing to the text field "S2"

    • Edit-formula: TTOC(S1)

    • Printing result: "20:30:40"

  • Example 2: When converting time-type data from the field "S1" to text-type data in "HH:MM:SS" format, and using as the value of the text field "S2"

    • Calculation-formula: TTOC(S1)

    • Printing result: "20:30:40"

  • Example 3: When converting the system time to text-type data in "HH:MM:SS" format, and printing to the text field "S2"

    • Edit-formula: TTOC(TIME())

    • Printing result: "20:30:40"

TIME

Feature

Retrieves the system time.

Format

TIME()

Settings

This will retrieve the system time at the time of printing (when the TIME function is executed) as time-type data (HHMMSS).

Usage examples

  • Example 1

    In the text-type field "S2", to output the system time as time data in HHMMSS format

    In the numeric-type field "I2", to output the system time as time data in HHMMSS format

    • Edit-formula: TIME()

    • Printing result

      Text-type field "S2": 203040

      Numeric-type field "I2": 203040

  • Example 2: As the value of the text-type field "S2" or the numeric-type field "I2", to convert and retrieve the system time to time data in HHMMSS format

    • Calculation-formula

      Text-type field "S2": TIME()

      Numeric field "I2": VAL(TIME())

    • Printing result

      Text-type field "S2": 203040

      Numeric-type field "I2": 203040

  • Example 3: When printing the system time as text-type data in "HH:MM:SS" format to the text field "S2"

    • Edit-formula: TTOC(TIME())

    • Printing result: "20:30:40"

ITIME

Feature

Retrieves the system time.

Format

ITIME()

Settings

This will retrieve the system time at the time of printing as time-type data (HHMMSS).

Usage examples

Reference

Specify this function if you want to print the same printing time on all of the pages in the same spool data.

  • Example 1

    In the text-type field "S2", to output the system time at the time of printing (executing VrInit function) as time data in HHMMSS format

    In the numeric-type field "I2", to output the system time at the time of printing (executing VrInit function) as time data in HHMMSS format

    • Edit-formula: ITIME()

    • Printing result

      Text-type field "S2": 203040

      Numeric-type field "I2": 203040

  • Example 2: As the value of the text-type field "S2" or the numeric-type field "I2", to convert and retrieve the system time to time data in HHMMSS format

    • Calculation-formula

      Text-type field "S2": ITIME()

      Numeric field "I2": VAL(ITIME())

    • Printing result

      Text-type field "S2": 203040

      Numeric-type field "I2": 203040

  • Example 3: When the system time at the time of printing (at VrInit function execution) is to be used as text-type data in "HH:MM:SS" format in the text field "S2"

    • Calculation-formula: TTOC(ITIME())

    • Printing result: "20:30:40"

CTOT

Feature

Converts text-type data (HH:MM:SS) into time-type data (HHMMSS).

Format

CTOT(string_or_character_field_name)

Settings

  1. In "string_or_character_field_name", specify the text-type data to convert, or the name of the text field that contains the data.

  2. This will convert "string_or_character_field_name" into time-type data.

Caution

The argument should be data from 00:00:00 to 23:59:59.

Usage examples

Prerequisite

When character data "20:30:40" is entered in the text field "S1"

  • Example 1: When converting text-type data from the field "S1" to HHMMSS time-type data, and printing to the text field "S2"

    • Edit-formula: CTOT(S1)

    • Printing result: 203040

  • Example 2: When converting text-type data from the field "S1" to HHMMSS time-type data, and using as the value of the text field "S2"

    • Calculation-formula: CTOT(S1)

    • Printing result: 203040

HOUR

Feature

Retrieves only hours (HH) as numeric-type data from time-type data (HHMMSS).

Format

HOUR(time_data)

Settings

  1. In "time_data", specify the time-type data/text-type data from which to retrieve the hours, or the name of the field that contains the data.

  2. This will retrieve only the HH part from "time_data" as numeric-type data.

Caution

  • The argument should be data from 000000 to 235959.

  • Because the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result.

Usage examples

Prerequisite

When time data "203040" is entered in the text-type field "S1"

  • Example 1: When retrieving only the Hour: "HH" from time-type data from the field "S1", and printing to the numeric field "I2"

    • Edit-formula: FORMAT(HOUR(S1),"99")

    • Printing result: "20"

  • Example 2: When retrieving only the Hour: "HH" from time-type data from the field "S1", and using it as the value of the numeric field "I2"

    • Calculation-formula: HOUR(S1)

    • Printing result: 20

  • Example 3: When retrieving time-type data from the system time, and using only the Hour: "HH" as the value of the text field "S2"

    • Edit-formula: STR(HOUR(TIME()))

    • Printing result: "20"

MINT

Feature

Retrieves only minutes (MM) as numeric-type data from time-type data (HHMMSS).

Format

MINT(time_data)

Settings

  1. In "time_data", specify the time-type data/text-type data from which to retrieve the minutes, or the name of the field that contains the data.

  2. This will retrieve only the MM part from "time_data" as numeric-type data.

Caution

  • The argument should be data from 000000 to 235959.

  • Because the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result.

Usage examples

Prerequisite

When time data "203040" is entered in the text-type field "S1"

  • Example 1: When retrieving only the Minutes: "MM" from time-type data from the field "S1", and printing to the numeric field "I2"

    • Edit-formula: FORMAT(MINT(S1),"99")

    • Printing result: "30"

  • Example 2: When retrieving only the Minutes: "MM" from time-type data from the field "S1", and using it as the value of the numeric field "I2"

    • Calculation-formula: MINT(S1)

    • Printing result: 30

  • Example 3: When retrieving time-type data from the system time, and using only the Minutes: "MM" as the value of the text field "S2"

    • Edit-formula: STR(MINT(TIME()))

    • Printing result: "30"

SEC

Feature

Retrieves only seconds (SS) as numeric-type data from time-type data (HHMMSS).

Format

SEC(time_data)

Settings

  1. In "time_data", specify the time-type data/text-type data from which to retrieve the seconds, or the name of the field that contains the data.

  2. This will retrieve only the SS part from "time_data" as numeric-type data.

Caution

  • The argument should be data from 000000 to 235959.

  • Because the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result.

Usage examples

Prerequisite

When time data "203040" is entered in the text-type field "S1"

  • Example 1: When retrieving only the Seconds: "SS" from time-type data from the field "S1", and printing to the numeric field "I2"

    • Edit-formula: FORMAT(SEC(S1),"99")

    • Printing result: "40"

  • Example 2: When retrieving only the Seconds: "SS" from time-type data from the field "S1", and using it as the value of the numeric field "I2"

    • Calculation-formula: SEC(S1)

    • Printing result: 40

  • Example 3: When retrieving time-type data from the system time, and using only the Seconds: "SS" as the value of the text field "S2"

    • Edit-formula: STR(SEC(TIME()))

    • Printing result: "40"