Definitely. You can use the DATE[1], DATE[1] and DATE[3] and DATE[4] variables for reading/setting the date and TIME[1], TIME[2] and TIME[3] variables for reading/setting the time (hour, minute, second) from within the custom function. Please refer to the chapter "TBASIC Statements, Functions and Variable" regarding the definition of these variables.
You can set the date/time remotely via the TRiLOGI software or by activating some custom functions to set it from within the custom function.