Set start value of a date in a form

Set start value of a date in a form

by Jose Velazquez-Torres -
Number of replies: 0

I want to set the current date of the user as the start value for day, month and year. 

$mform->addElement('date_selector', 'assesstimefinish', get_string('to'));

        array(

            'startmonth' => userdate(),

            'stopmonth'  => January,

            'startyear' => 2021,

            'stopyear'  => 2021,

            'timezone'  => 99,

            'optional'  => false

        );

This is what I currently have for that. Could someone set me in the right direction to set the start paramaters to the current dat?

Average of ratings: -