https://www.excel-easy.com/vba/date-time.htmlthanks claudio:
Claudio H
On Thursday, August 25, 2022 at 10:10:26 PM UTC+5:30, Claudio H wrote:
https://www.excel-easy.com/vba/date-time.html
Claudio Hthanks claudio:
please, would you also type the 'xhb syntax' to convert. data type 'T' to data type 'C'
my example:
'einvackdt:=osheet:cells(21,14):value' (Type T)
? einvackdt shows 17-04-2022 15:11:00
einvackdt1=dtoc(einvackdt) WORKS but (obviously) gives only the date.
i tried :
xxx=str(einvackdt)
xxx=substr(einvackdt,11,6) && THIS CRASHES
xxx=val(einvackdt) && gives 0
xxx=right(einvackdt,8)
but xxx does not show '15:11:00'
is there a func similar to dtoc() like a ttoc().....
El jueves, 25 de agosto de 2022 a las 20:36:42 UTC-5, timec...@gmail.com escribió:
On Thursday, August 25, 2022 at 10:10:26 PM UTC+5:30, Claudio H wrote:
https://www.excel-easy.com/vba/date-time.html
Claudio Hthanks claudio:
please, would you also type the 'xhb syntax' to convert. data type 'T' to data type 'C'
my example:
'einvackdt:=osheet:cells(21,14):value' (Type T)
? einvackdt shows 17-04-2022 15:11:00
einvackdt1=dtoc(einvackdt) WORKS but (obviously) gives only the date.
i tried :
xxx=str(einvackdt)
xxx=substr(einvackdt,11,6) && THIS CRASHES
xxx=val(einvackdt) && gives 0
xxx=right(einvackdt,8)
but xxx does not show '15:11:00'
is there a func similar to dtoc() like a ttoc().....Try
TtoC()
Converts a DateTime value to a character string in SET DATE and SET TIME format.
Syntax
TtoC( <dDateTime> ) --> cDateTimeString
Arguments
<dDateTime>
The parameter must be a value of data type Date or DateTime.
Return
The return value is a character string formatted in the current SET DATE and SET TIME format.
Description
The function converts a DateTime value to a character string. The string is formatted according to the current SET DATE and SET TIME format.
Important: use TtoC() and its counterpart CtoT() with extreme care. The result of both functions depends on the current SET DATE, SET EPOCH and SET TIME settings.
Info
See also: DateTime(), DtoC(), SET CENTURY, SET DATE, SET EPOCH, SET TIME, StoT(), TtoC(), TtoS()
Category: Conversion functions, Date and time, xHarbour extensions
Source: rtl\dateshb.c
LIB: xhb.lib
DLL: xhbdll.dll
1842
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 456 |
Nodes: | 16 (2 / 14) |
Uptime: | 103:15:46 |
Calls: | 9,320 |
Files: | 13,530 |
Messages: | 6,079,748 |