Hi,
I need to display a DateTime axis where the labes show hours and minutes.
I found no way to display e.g. 26h as 26:00. Is there any workaround for that? I would accept to get 1d 2h 0m, but the calculation always starts at the 30. (december 1899) so I get 31:02:00.
I already have caught the data in the OnGetAxisLabel Event and tried to use global variables to change the LabelText. This did not work because I can't see any system in the order of the incoming values.
Would be fine to fix that.
Thanks, Messie
TeeChart Pro 7.07 w/o code
DateTime hours "overflow" after 24h
Hi Messie,
If we understand well, you would like to start a timer when your application starts and add your points with date relative to this start or relative to one known date. So, you could subtract the initial date from the date at the moment of the point addition to obtain the relative date.
If we understand well, you would like to start a timer when your application starts and add your points with date relative to this start or relative to one known date. So, you could subtract the initial date from the date at the moment of the point addition to obtain the relative date.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 7
- Joined: Thu Oct 18, 2007 12:00 am
This is a formatting problem. 36 h are 1.5 in datetime format. If you format this with FormatDateTime('dd - hh:nn',1.5) it will Return 31 - 12:00
(31 from 31.12.1899 (thats day 1))
use this instead of FormatDateTime:
GetTimeDiffStr(1.5)
and you will get "1 - 12:00"
(31 from 31.12.1899 (thats day 1))
use this instead of FormatDateTime:
Code: Select all
function GetTimeDiffStr(dTimeDiff:TDateTime):string;
var
sDays:string;
begin
if Abs(dTimeDiff) >= 1
then sDays := IntToStr(trunc(Abs(dTimeDiff))) + ' - '
else sDays := '';
Result := sDays + FormatDateTime('hh:nn:ss',Abs(dTimeDiff));
end;
and you will get "1 - 12:00"