Closed Thread
Results 1 to 8 of 8

Thread: Getting real time information in Dev Pascal - please HELP (urgent!)

  1. #1
    vµki is offline Newbie
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Exclamation Getting real time information in Dev Pascal - please HELP (urgent!)

    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

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,494
    Blog Entries
    75
    Rep Power
    143

    Re: Getting real time information in Dev Pascal - please HELP (urgent!)

    How about the Now function?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    vµki is offline Newbie
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Re: Getting real time information in Dev Pascal - please HELP (urgent!)

    Quote Originally Posted by WingedPanther View Post
    How about the Now function?
    Never heard of that one...
    If it's not too much to ask, can you write the code ?

    What I need to know is the exact day and hour. Or just day...

    Thanks in advance, WingedPanther !

  5. #4
    Join Date
    Jul 2006
    Posts
    16,494
    Blog Entries
    75
    Rep Power
    143

    Re: Getting real time information in Dev Pascal - please HELP (urgent!)

    Check out DecodeDate and DecodeTime at: Newbie Pascal Functions
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    vµki is offline Newbie
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Re: Getting real time information in Dev Pascal - please HELP (urgent!)

    Just what I've been looking for

    Thank you very much, Panther !

  7. #6
    vµki is offline Newbie
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Re: Getting real time information in Dev Pascal - please HELP (urgent!)

    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 ?

  8. #7
    Join Date
    Jul 2006
    Posts
    16,494
    Blog Entries
    75
    Rep Power
    143

    Re: Getting real time information in Dev Pascal - please HELP (urgent!)

    The declaration of DecodeDate is:
    Code:
    procedure DecodeDate(const DateTime: TDateTime; var Year, Month, Day: Word);
    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 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;
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  9. #8
    vµki is offline Newbie
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Re: Getting real time information in Dev Pascal - please HELP (urgent!)

    Thank you very much, Panther, you've been really helpful It's working !

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Real time scanner on C
    By vallenoire in forum C and C++
    Replies: 7
    Last Post: 03-02-2010, 10:17 PM
  2. real time scanner is it possible in VB?
    By vallenoire in forum Visual Basic Programming
    Replies: 2
    Last Post: 02-28-2010, 06:30 AM
  3. Real time data
    By techissue2008 in forum General Programming
    Replies: 1
    Last Post: 04-06-2008, 06:10 AM
  4. Real-time graphs
    By Badmaash in forum C# Programming
    Replies: 6
    Last Post: 10-15-2007, 12:23 PM
  5. Real Time?
    By DiscoBob in forum PHP Development
    Replies: 6
    Last Post: 07-13-2006, 10:51 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts