Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TdateTime Acurate

Posted on 1999-01-21
8
Medium Priority
?
280 Views
Last Modified: 2010-04-06
hi
i have to var type TdateTime there value is 35983.0833333333285 35983.0833333333333 but there DateTimeToStr are the same , why is that ?
what should i do to prevent it ?
10x
Asi
0
Comment
Question by:asi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 

Author Comment

by:asi
ID: 1362712
does 1/24 is exactly one hour (in TdateTime format) ?
10x
0
 
LVL 17

Expert Comment

by:inthe
ID: 1362713
what are you trying to do?
what does this do
Edit1.Text:=DateTimeToStr(Now);

Regards Barry

0
 

Author Comment

by:asi
ID: 1362714

if the last unswer is yes
why does look at the value of this one frac(StrToDateTime('11/11/11 01:00:00'))  are not equal to 1/24 (according to delphi) ?

and for inthe :
i"m tring to understand why to Variable from the same type that suppose to show the exact value are not .....

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Expert Comment

by:Madshi
ID: 1362715
There's more in a TDateTime than just seconds. There are milliseconds in it, too. And they are not included in the string.

Regards, Madshi.
0
 

Author Comment

by:asi
ID: 1362716
so what showd i do , in case that i want only milisocond ... (and look about the other  Comment,please)
0
 
LVL 2

Expert Comment

by:lortega
ID: 1362717
if you use FormatDateTime you can see the difference...
0
 
LVL 2

Accepted Solution

by:
lortega earned 30 total points
ID: 1362718
if you want to use milisecond for any kind of comparison or
just random numbers then use DecodeTime...

procedure TForm1.Button1Click(Sender: TObject);

var
  Present: TDateTime;
  Hour, Min, Sec, MSec: Word;
 begin
  Present:= Now;    {or the variable that you want...}
  DecodeTime(Present, Hour, Min, Sec, MSec);
  Label2.Caption := 'The time is Minute ' + IntToStr(Min) + ' of Hour ' + IntToStr(Hour);
end;


good luck,
luis

0
 
LVL 17

Expert Comment

by:inthe
ID: 1362719
hey that works nice
Regarsd Barry

0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question