Home » Developer & Programmer » Forms » DATE AND TIME IN FORMS... URGENT!
DATE AND TIME IN FORMS... URGENT! [message #193089] Thu, 14 September 2006 20:57 Go to next message
jamesrussell15
Messages: 16
Registered: September 2006
Location: philippines
Junior Member

HELLO THERE!
GUD DAY!

HOW TO CODE THE AUTOMATIC TIME AND DATE IN FORMS.

SO THAT EVERYTIME I LOGGED IN TIME AND DATE ALREADY DISPLAYED.

THANK YOU...

HAVE A NICE DAY!

BADLY NEEDED THIS CODE..

THANKS AGAIN!


RUSSELL
Re: DATE AND TIME IN FORMS... URGENT! [message #193116 is a reply to message #193089] Thu, 14 September 2006 23:18 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Is your caps lock key stuck?? You have posted four messages today ALL of them in upper case. Stop shouting and stop in now!

Where do you want this display to appear on the screen? Create a date or datetime field and define the 'format' in its property sheet. Then populate it in the When-New-Form-Instance trigger with:
:blk.itm:=sysdate;

David
Re: DATE AND TIME IN FORMS... URGENT! [message #193409 is a reply to message #193089] Sat, 16 September 2006 06:22 Go to previous messageGo to next message
Liza79
Messages: 74
Registered: September 2006
Member
you can also set the initial value property for the Date Item which is meant to display the current date.

And set the value to $$DBDATE$$ for the date and $$DBTIME$$ for time.

i am not sure about this $ it might be a single, you may check it.

Re: DATE AND TIME IN FORMS... URGENT! [message #203097 is a reply to message #193409] Mon, 13 November 2006 21:48 Go to previous messageGo to next message
ehegagoka
Messages: 493
Registered: July 2005
Senior Member
hi!
i tried the suggested way of $$DBTIME$$ but it's not changing, i mean it's not like a clock, can i make it "run" while the form is being use? thanks sir/mam
Re: DATE AND TIME IN FORMS... URGENT! [message #203110 is a reply to message #203097] Mon, 13 November 2006 22:46 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Oracle Forms runs in block mode. If you want real-time bits then you will have to use Java. Search this forum / site / google for 'java clock' or go to the Oracle Forms site and look at the Java bits and pieces that they have there.

This assumes that the version of Forms that you are using (and which you haven't specified) supports Java.

David
Re: DATE AND TIME IN FORMS... URGENT! [message #203125 is a reply to message #203110] Mon, 13 November 2006 23:58 Go to previous messageGo to next message
ehegagoka
Messages: 493
Registered: July 2005
Senior Member
hi!
im using forms 6i, im doing a stand-alone module, so i dont have any forms server as from what ive seen on the java clock, thanks again =)
Re: DATE AND TIME IN FORMS... URGENT! [message #203171 is a reply to message #203125] Tue, 14 November 2006 03:19 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

You can use timer in forms 6i to display a clock.

Method:

Create a Display Item. Data Type is Char.

In When-New-Form-Instance Trigger, write this code:

DECLARE
 CurrTime TIMER;
 OneSecond   CONSTANT NUMBER := 1000;
BEGIN
 CurrTime := CREATE_TIMER('CURRTIME',OneSecond,REPEAT);
END;


In When-TImer-Expired Trigger, write this code

DECLARE
 ExpTimer VARCHAR2(40) := Get_Application_Property(TIMER_NAME);
 vTime Varchar2(30)    := :SYSTEM.CURRENT_DATETIME;
BEGIN
	IF ExpTimer = 'CURRTIME' THEN
		:Your_Block_Nmae.Item_Name := to_char(sysdate,'HH24:MMI:SS');
	END IF;
END;


Note:

Using timers in form builder can kill the performance of the machine if the machine has not good configuration.

I'll recommend at least Pentium4 with more than 3GHZ Intel Processor and 512 MB ram.

Search Words : timer, timer in forms6i, clock in forms6i

regards,
Saadat Ahmad

[Updated on: Tue, 14 November 2006 03:21]

Report message to a moderator

Re: DATE AND TIME IN FORMS... URGENT! [message #203185 is a reply to message #203171] Tue, 14 November 2006 03:57 Go to previous message
ehegagoka
Messages: 493
Registered: July 2005
Senior Member
hi!,
thank you so much for the reply, ill try this and also check if it would run slow on a span of 1 minute, thanks again!
Previous Topic: Record group
Next Topic: scroll bar
Goto Forum:
  


Current Time: Thu Dec 08 12:47:21 CST 2016

Total time taken to generate the page: 0.16274 seconds