xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

CtoT()

Converts a character string into a DateTime value

Syntax

CtoT( <cDateTimeString> ) --> dDateTime

Arguments

<cDateTimeString>
This is a character string formatted as a DateTime value. Digits for day, month and year plus the separator sign must comply with the current SET DATE format. If the year is not given as a four digit number, the rules for SET EPOCH apply for the DateTime conversion.

Return

The function returns the converted DateTime value. If <cDateTimeString> is not a valid DateTime string, an empty DateTime value is returned.

Description

The conversion function CtoT() is used to create DateTime values from string literals formatted as a DateTime. Such literals are returned from function TtoC(). Formatting of the string literal must comply with the current SET DATE format. That is, digits for day, month and year in <cDateString> are interpreted according to the sequence of the letters dd, mm and yy in the SET DATE format string.

The Time part of the DateTime value must be formatted as "hh:mm:ss.ccc". (refer to SET TIME). If the Time part is omitted from <cDateTimeString>, the Time part in the return value is set to 00:00:00.

The conversion rules of SET EPOCH apply for the year when it is not specified with four digits.

Use function StoT() to convert a string to a DateTime value independently of SET DATE.

Info

See also:CtoD(), DateTime(), SET CENTURY, SET DATE, SET TIME, SET EPOCH, StoT(), TtoC(), TtoS()
Category: Conversion functions , Date and time , xHarbour extensions
Source:rtl\dateshb.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe