realbasic-nug
[Top] [All Lists]

Re: Stupid date/time question

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Stupid date/time question
From: Fargo Holiday <fargo at rpgportland dot com>
Date: Sat, 28 Oct 2006 18:55:13 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <C169548D dot 4B15D%support at groundlevel dot net>
Well, as with most things, there's quite a number of ways to do that. The first one that popped to mind for me is to use a timer. Drop a new timer into your form area, select it and set the Period to something that suits you. I found the 100 worked pretty well. That's in ms, if I'm not mistaken, so the timer's action will fire every 100th of a second. To see the output add a static text box, then go to the code edit view and select the Action for the timer. In there, pop in this:

 dim the_time As Date
 the_time = new Date
StaticText1.Text = the_time.LongDate + " " + CStr(the_time.Hour) + ":" + CStr(the_time.Minute) + ":" + CStr(the_time.Second)

Run it and you should see the text updating.

If you need to constantly poll, you could use a thread and loop approach, but that'd likely be overkill.

Hope that helped,
Fargo

Jeffrey Ellis wrote:
Can someone tell me how to have an app constantly checking the system for
the current date/time?

Thanks :)

All My Best,
Jeffrey


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>