how to get system date in jade

For questions and postings not covered by the other forums
mario
Posts: 11
Joined: Fri Sep 04, 2009 11:02 am

how to get system date in jade

Postby mario » Wed Nov 04, 2009 7:02 pm

hi guys,
I got a text box called txtDate on my form and I want it to display current system date everytime i run the form.
How is it possible?

cheers, mario :)

murray
Posts: 144
Joined: Fri Aug 14, 2009 6:58 pm
Location: New Plymouth, New Zealand

Re: how to get system date in jade

Postby murray » Wed Nov 04, 2009 9:29 pm

What part of that are you having trouble with? The "actualTime...." methods on the Application class may help. It is in the EncycloSys1.pdf manual. The Time and Date 'format' methods may also be useful.
Another way to approach it could be to utilise the 'formatOut' property of a TextBox or Label (in EncycloWin.pdf).
Murray (N.Z.)

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: how to get system date in jade

Postby ghosttie » Thu Nov 05, 2009 2:28 am

Date variables are initialized to the current date, so you'd just have to do something like this:

Code: Select all

vars d : Date; begin txtDate.text := d.format(app.currentLocaleInfo.dateInfo.shortFormat); end;
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: how to get system date in jade

Postby BeeJay » Thu Nov 05, 2009 7:49 am

You can also simplify your code further by using a JadeEditMask instead of a TextBox control for the field that will display the date. Then, to set the the JadeEditMask::text property in a locale aware format you can use the JadeEditMask::setTextFromDate( <date> ) method. The following code snippet is an example of setting the JadeEditMask::text property to the current date as viewed by the machine hosting the DbServer.

Code: Select all

jemDate.setTextFromDate( app.actualTimeServer.date );
You may want to read up on the JadeEditMask's other setTextFromXXXX methods, and also their "partner" getTextAsXXXX methods, for dealing with Dates, Decimals, Integers, Reals, and Times.

Cheers,
BeeJay.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests