Getting current system time and date...

Hi, i used to use the regular TP, andthere i use GETDATE(year,month,day,weekday); but thats in the dos unit, and delphi doesnt have it :-)so... i need to find delpi's way to do it :-) i have searched thorugh the help thingy, but i couldnt find..

if anyone could help push me a little in the right direction? :-)

oh also, is there something in delphi (or some simple way) to compare 2 dates/times and check the date/time difference? (preferly in secs?)

Comments

: Hi, i used to use the regular TP, andthere i use GETDATE(year,month,day,weekday); but thats in the dos unit, and delphi doesnt have it :-): so... i need to find delpi's way to do it :-) i have searched thorugh the help thingy, but i couldnt find..: : if anyone could help push me a little in the right direction? :-): : oh also, is there something in delphi (or some simple way) to compare 2 dates/times and check the date/time difference? (preferly in secs?):

: : Hi, i used to use the regular TP, andthere i use GETDATE(year,month,day,weekday); but thats in the dos unit, and delphi doesnt have it :-): : so... i need to find delpi's way to do it :-) i have searched thorugh the help thingy, but i couldnt find..: : : : if anyone could help push me a little in the right direction? :-): : : : oh also, is there something in delphi (or some simple way) to compare 2 dates/times and check the date/time difference? (preferly in secs?): : : : Here is an example on how to get the system date and time:: : datetimetostring(s, 'dddd mmmm d, 2001 - h:nn:ssam/pm', now);: showmessage(s);: : And if you have two dates in TDateTime format, you just subtract one from the other. That will get the number of days difference. If you multiply that by 86400 you will get the difference in seconds.:

Oops had a brain-fart there. 2001 should be yyyy to get the current 4 digit year.