I have just one more day to finish my program and I can't find a way to do this.
What I want to do is to know the real time (GMT+1) (time that is displayed in System Tray)...One variable will have a string hh:mm that I will then use for some more serious things...
Please help me ! Appreciate it a lot![]()
How about the Now function?
Check out DecodeDate and DecodeTime at: Newbie Pascal Functions
Just what I've been looking for
Thank you very much, Panther !
Ok, this isn't working...I 've got lots of procedures, and I should simply put
procedure DecodeDate(const DateTime: TDateTime; var Year, Month, Day: Word);
among those and that's it ? No begin, no end of the procedure, just that ?
How do I call her while in program ? Simply
DecodeDate;
or how ?
I'm getting errors and this is quite confusing when using for the 1st time. Can someone explain how to use this like to a 3-year old ?![]()
The declaration of DecodeDate is:
What this tells you is that DecodeDate requires four parameters, the date as a TDateTime, the year, month and day as integer types. The year, month and day will be updated by the function. You can use it in code like this:Code:procedure DecodeDate(const DateTime: TDateTime; var Year, Month, Day: Word);
Code:procedure MyProcedure var MyDate: TDateTime; MyMonth, MyDay, MyYear: integer; begin MyDate := now(); // on Apr 4, 2009 DecodeDate(MyDate,MyYear,MyMonth,MyDay); //In my timezone at the time of writing this, the variables are as follows: //MyMonth = 4 //MyYear = 2009 //MyDay = 26 end;
Thank you very much, Panther, you've been really helpfulIt's working !
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks