Will put "Hello World" below the specified field.
current.field_name.setError("Hello World");
Will put "Hello World" on the top of the screen.
gs.addInfoMessage("Hello World");
Will write to the text log on the file system but not to the sys_log table in the database.
gs.print("Hello World");
Will write to the database and the log file.
gs.log("Hello World");
getTimeDiff();
function getTimeDiff(){
var startDate = current.u_start_date.getGlideObject();
var endDate = current.u_end_date.getGlideObject();
current.u_duration = gs.dateDiff(startDate.getDisplayValueInternal(),endDate.getDisplayValueInternal(),false);
}