How can i set an external datetime variable to the current time

 
 
external variable is no different from other variables you can set it from inside and outside.

extern int extTime;

extTime=Curtime();

I don't know why do you want to make it external. External dates are kinda hard to set. You have to figure out how many seconds have passed since 1970 and then set it as int.

it will be easier to set it as string;

extern string strTime="2006.10.05 10:00";


datetime extTime=StrToTime(strTime);
 
Oh I need it to be one of the parameters when the script starts. The user has to enter a date of the entry. I thought the variable has to be extern for that. I want it to be set to the current date and time when it shows up in the input window right when you start the script so I wouldn't have to adjust it everyday.
 
you can try this code:

#property show_inputs
 
 
extern string SetTime="today";
 
timedate UserTime;
 
int start()
{
   if(SetTime="today")
       UserTime=CurTime();
   else
      UserTime=StrToTime(SetTime);
....
Reason: