System time

How do I enter the current time in a field now in scriptcase. Can someone help me? Thank you

What you suggest works well for the system date, but if the field is time I can not get the system time. Can you give me an alternative? Thank you

I attach two images [ATTACH=CONFIG]n82775[/ATTACH] [ATTACH=CONFIG]n82776[/ATTACH]

image1.jpg

image2.jpg

ONLOAD RECORD

{orderdate} = [SIZE=15px]date(“h:i:s”);[/SIZE]

I tried to create an “onLoad” event as you suggested, inserting the string you wrote, but the time field always remains with 00.00.00. Am I wrong?

Why onLoad?
OnLoad will then change your time every time you open the record.

I usually use onClick AjaxEvent to enter the current time automatically.

So, if your field is “tonometria” then you create an onClick AjaxEvent like this:

AjaxEvent = [LEFT][SIZE=12px]tonometria_onClick[/SIZE][/LEFT]

code:

$time=date(“H:i”);

{tonometria} = $time;

You can do it in Onload event:

if (sc_btn_new) {
// Set the date here!.

}

Exactly, you’re right.
I forgot that this could also be an option.

“If new”

Thanks for your suggestions, I attach 4 images of the results with the two methods, from this you will understand that I still need your help. Thank you

  1. Ajax OnClick Event —> result image3.jpg, image4.jpg
  2. OnLoad event ---------> result image5.jpg, image6.jpg [ATTACH=CONFIG]n82785[/ATTACH] [ATTACH=CONFIG]n82786[/ATTACH] [ATTACH=CONFIG]n82787[/ATTACH] [ATTACH=CONFIG]n82788[/ATTACH]

image3.jpg

image4.jpg

image6.jpg

image5.jpg

Why did you change the code?
You replaced the word “date” with the word “time”. Does not work!
Leave the code exactly as we wrote and tried:

$time=date(“H:i:s”)
{OraTonometria} = $time;

I had also tried with ‘date’, but it gives me a strange value, as you can see in the image that I attach to you.

$time = date (“H: i: s”);
{OraTonometria} = $time;

image10.jpg

Hmm, very strange.
You can post the image from the OraTonometria field settings?

[ATTACH=CONFIG]n82798[/ATTACH]

field.jpg

These are the settings

[ATTACH=CONFIG]n82807[/ATTACH]

image11.jpg

Everything looks OK, as with me.
It works for me, but not for you.
Sorry, but I really do not know what else could be wrong.

I solved with the following steps:

  1. Programming - PHP methods - I create a ‘time ()’ function with the following instructions:
    $ time = date (“H: i: s”);
    {TimeTonometry} = $ time;

  2. Events - OnLoad - ‘time ();

It works perfectly!!! Thanks to everyone who tried to help me!