Questions tagged [tdatetime]
48 questions
2
votes
2 answers
Calculating time length between operations in c++
The program is a middleware between a database and application. For each database access I most calculate the time length in milliseconds. The example bellow is using TDateTime from Builder library. I must, as far as possible, only use standard c++…

PLS
- 231
- 2
- 6
- 14
2
votes
1 answer
C++ variable type alike Builder TDateTime type
I'm looking for variable type (in standard C++ libraries) that could easily substitute TDateTime. What I need is hour, minutes, seconds and miliseconds.
Thanks for the attention

PLS
- 231
- 2
- 6
- 14
2
votes
3 answers
Encode Time Issue in Delphi 2010
When we use EncodeTime function EncodeTime(wHour, wMinute, wSecond, wMilliseconds) it is not assigning the millisec value to the Result.
We are using below to encode Date and Time
Result := EncodeDate(wYear, wMonth, wDay) +
EncodeTime(wHour,…

SSE
- 445
- 2
- 10
- 29
2
votes
2 answers
Function Now: Tdatetime for Perpetual Calendar
I am trying to write a function for Tdatetime (but when I open my program, he must show now data)
Below i have a function for TDatetime but I have an error in that:
((((''DecodeDateTime(data, rok, miesiac, dzien, godzina, minuta, sekunda,…

Pewi
- 35
- 1
- 6
2
votes
0 answers
Is it possible to store date and time inside an Integer?
I've created a logger that parse big .txt archives and convert each line of the file to an TObject composed of:
_date: TDateTime;
_ip: Integer;
_port: Word;
_bytes: TBytes;
Example of line:
01/12/2017 18:01:59.999 192.168.1.64:50000 0100021DC8
date…

noen
- 346
- 3
- 10
2
votes
2 answers
Internal format of TDateTime in Delphi 7?
I've spent many hours researching this and am pretty stuck: my question is - has the internal format of a Delphi TDateTime changed between Delphi 7 (released in 2002 or so) and today?
Scenario: I'm reading a binary logfile created by a Delphi 7…

Steve Friedl
- 3,929
- 1
- 23
- 30
2
votes
1 answer
MonthOf TDateTime ambiguity
I am using C++ Builder and am creating a GUI application using the TDateTime data type.
When I use the MonthOf() method on a TDateTime object, I am getting a value that is 1 month behind from the actual month of the TDateTime object.
Why is this? Is…

user1690531
- 231
- 1
- 6
- 17
2
votes
3 answers
How to check TDateTime contents are valid
Is there a way to check whether a Delphi TDateTime variable has valid contents without trapping exceptions on conversions?
I have written an application that has to parse through hundreds of huge files written as raw Delphi records that contain a…

Stargate
- 21
- 1
- 2
1
vote
1 answer
Delphi: convert TDate to other format
var MyDate:TDate;
MyDate:=Date;
How can I convert local myDate to my format: 31/12/2011?
RecodeDate?
Thanks!!!

maxfax
- 4,281
- 12
- 74
- 120
1
vote
2 answers
How to convert a Pascal TDateTime(double) time to a Unix epoch in C++
I need to convert from a Pascal TDateTime object which is a double value to Unix epoch using c++.
A possible solution is proposed (https://forextester.com/forum/viewtopic.php?f=8&t=1000):
unsigned int UnixStartDate = 25569;
unsigned int…

Andrew
- 626
- 6
- 16
1
vote
1 answer
Posix timezone string to Olson string
We have an embedded Linux system where the user needs to be able to permanently set the system's timezone by supplying a POSIX string (e.g. WEuropeStandardTime-1DaylightTime,M3.5.0,M10.5.0/3).
The user interacts with the system over a webservice we…

JPh
- 536
- 3
- 20
1
vote
1 answer
Trying to create data transfer rate calculator using Lazarus and Freepascal
I am trying to add to my application interface a "Transfer Rate : XGb p\min" feature. I am computing it at a millisecond level using Lazarus 1.2.2 and Freepascal 2.6.4.
I have a loop that reads 64Kb blocks from a disk, does stuff with each 64Kb…

Gizmo_the_Great
- 979
- 13
- 28
1
vote
0 answers
Delphi XE2: Retrieving LastLogon Int64 to TDateTime conversion
I am trying to get the LastLogin information from AD at my work.
I have about 1200 accounts. When i run a Query and include the LastLogin information, for about 40 - 45% of the accounts, i get a correct Date returned. For the others, i get a default…

Anomander
- 11
- 2
1
vote
1 answer
Whats wrong with TDateTime value
I have a TDateTime variable called currMonth. currMonth's value is "6/30/2000 11:59:59 PM".
I need to insert currMonth as default value for a field at TDBGrid called dtBegin.
I try this code :
dtBegin->AsDateTime = currMonth;
And the compiler is…

Jessie M
- 498
- 1
- 9
- 23
1
vote
1 answer
How to replace Day of TDateTime type on runtime
I have TDateTime variable named dtBegin. dtBegin is containing value "7/3/2000".
I need to replace the Day only with "2" to change the value into "2/3/2000".
How to do this? I've been suggested to use RecodeDay() method in C++ Builder XE but the…

Jessie M
- 498
- 1
- 9
- 23