Skip to main content
Topic: current Time / Date in DefaultValue (Read 1891 times) previous topic - next topic

current Time / Date in DefaultValue

Hi,
i'm new in PHPRad an have a question for my first App.
I would like to set up an ADD page where the current date in the first field and the current time in the second field are the default. The fields must be changeable for the user, so I can not set the values ​​directly in the mySQL database.

How can I achieve this? I have prepared the following parameters in the field "DefaultVaule" "curtime ()", "time ()" and "time_now ()" but not working.

I have defined the fields and with a manual input of the time, this will be written to the database fine.

Thanks for your Help!

LG Joern

 

Re: current Time / Date in DefaultValue

Reply #1
@Joern Please do the following:
1.  For the first input, set the TextboxType to Date and set the Selected Date to this code
Code: [Select]
<?php echo date("Y-m-d",time()); ?>
2.  For the second input, set the TextboxType to Time and set the Selected Date to this code
Code: [Select]
<?php echo date("H:i:S",time()); ?>