Difference between revisions of "TTOC()"
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to convert a datetime expression to a string value in an optionally specified format | Function to convert a datetime expression to a string value in an optionally specified format | ||
− | |||
==Syntax== | ==Syntax== | ||
TTOC(<expT> [, <expN>]) | TTOC(<expT> [, <expN>]) | ||
− | |||
==See Also== | ==See Also== | ||
− | [[AMPM()]], [[CDOW()]], [[CMONTH()]], [[CTOD()]], [[CTOT()]], [[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()]], [[STOD()]], [[STR()]], [[TIME()]], [[TIMESTAMP()]], [[TSTRING()]], [[TTOD()]], [[TYPE()]], [[VAL()]], [[VALIDTIME()]], [[VTOD()]], [[WEEK()]], [[YEAR()]], [[SET CENTURY]], [[SET DATE]], [[SET EPOCH]], [[SET HOURS]], [[SET MARK]], [[SET SECONDS]] | + | [[AMPM()]], [[CDOW()]], [[CMONTH()]], [[CTOD()]], [[CTOT()]], [[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()]], [[STOD()]], [[STR()]], [[TIME()]], [[TIMESTAMP()]], [[TSTRING()]], [[TTOD()]], [[TYPE()]], [[VAL()]], [[VALIDTIME()]], [[VTOD()]], [[WEEK()]], [[YEAR()]], [[SET CENTURY]], [[SET DATE]], [[SET EPOCH]], [[SET HOURS]], [[SET MARK]], [[SET SECONDS]] |
− | + | ||
==Description== | ==Description== | ||
Line 16: | Line 13: | ||
<expN> | <expN> | ||
The optional <expN> can be used to specify the format of the return value: | The optional <expN> can be used to specify the format of the return value: | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 29: | Line 25: | ||
|- | |- | ||
|} | |} | ||
− | |||
==Example== | ==Example== | ||
Line 42: | Line 37: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] |
Revision as of 11:20, 9 February 2012
Contents
Purpose
Function to convert a datetime expression to a string value in an optionally specified format
Syntax
TTOC(<expT> [, <expN>])
See Also
AMPM(), CDOW(), CMONTH(), CTOD(), CTOT(), 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(), STOD(), STR(), TIME(), TIMESTAMP(), TSTRING(), TTOD(), TYPE(), VAL(), VALIDTIME(), VTOD(), WEEK(), YEAR(), SET CENTURY, SET DATE, SET EPOCH, SET HOURS, SET MARK, SET SECONDS
Description
The TTOC() function converts the datetime expression <expT> to a string value. By default, the date part of the string returned will conform to the current SET DATE, SET MARK and SET CENTURY settings, in the same format as DTOC(). The time will be returned in the format hh:mm:ss AM|PM. If the expression to be converted contains no time information, 12:00:00 AM will be assumed. If SET SECONDS is OFF (ON by default), no seconds will be displayed. The SET HOURS set command determines whether hours are shown in 24 hour format or in 12 hour format with AM | PM postfix.
<expN> The optional <expN> can be used to specify the format of the return value:
<expN> | Format |
---|---|
0 | As defaults |
1 | YYYYMMDDhhmmss |
2 | PM (SET SECONDS ON)
or hh:mm AM|PM (SET SECONDS OFF) |
Example
set date american ? ttoc({^2004-03-29 10:15:43 AM}) 03/29/2004 10:15:43 AM ? ttoc({^2004-03-29 10:15:43 AM},1) 20040329101543 ? ttoc({^2004-03-29 10:15:43 AM},2) 10:15:43 AM