CTOT()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to convert character to datetime

Syntax

CTOT(<expC>)

See Also

AMPM(), CDOW(), CMONTH(), CTOD(), DATE(), DATETIME(), DAY(), DAYS(), DMY(), DOW(), DTOC(), DTOM(), DTOS(), DTOV(), ELAPTIME(), EMPTY(), EPOCH(), GOMONTH(), HOUR(), HOURS(), LTOS(), MDY(), MINUTE(), MINUTES(), MONTH(), MTOD(), MTOS(), QUARTER(), SEC(), SECONDS(), SECS(), SET CENTURY, SET DATE, SET EPOCH, SET HOURS, SET MARK, SET SECONDS, STOD(), STR(), STOT(), TIME(), TIMESTAMP(), TSTRING(), TTOC(), TTOD(), TYPE(), VAL(), VALIDTIME(), VTOD(), WEEK(), YEAR()

Description

The CTOT() function is the character to datetime conversion function. It converts the character expression specified to a datetime variable. The character expression must be correctly formatted based on the current SET DATE, SET MARK, SET SECONDS and SET CENTURY settings. For example, the default settings, SET DATE AMERICAN, SET SECONDS ON and SET CENTURY ON, require a datetime in the format "MM/DD/YYYY HH:MM:SS AM/PM". If <expC> is an invalid datetime format the CTOT() function will return an empty datetime.

Example

mdate = ctot("01/21/2004 01:44:44 PM")
? mdate
01/21/2004 01:44:44 PM
? type("mdate")
T