toString Method

Class: Time

Description

This method returns a formatted string representation of the Time object.

Syntax

timeObject.toString(String format)

Parameters

format

The format in which to display the time. The default is the application mask loaded from DBCTLDVFM, or 24:60:SS if no application mask is specified.

Valid format codes include:

12

The hour of the day as a zero-filled number between 00 and 12.

24

The hour of the day as a zero-filled number between 00 and 23.

60

The minute of the hour as a zero-filled number between 00 and 59.

SS

The second of the minute as a zero-filled number between 00 and 59.

AM

The letters AM and PM depending on the time.

punctuation characters

Any of the following punctuation characters:

  • space

  • comma (,)

  • period (.)

  • slash (/)

  • colon (:)

  • semicolon (;)

  • asterisk (*)

  • plus sign (+)

  • minus sign (-)

Example

 12:60 AM

Returns

A formatted string representing the Time object.

When Became Available

Profile V7.0

Example

type RecordCIFSIG cifsig = Db.getRecord("CIFSIG","ACN=:ACN")

type Time TIME = cifsig.time // declare Time object

 

// Translate into ISO format

type String TIMEISO = TIME.toString("24:60:SS")

 

* Variable ACN must be defined prior to the getRecord statement.