remove time stamp from email notification

Rahul Gupta
Tera Contributor

Hi i am using the feild sys_created_on in my email notification but it includes the date and time .... As

 2004-01-22 00:00:00 EST

but i want only the date not the time stamp as 2004-01-22  ....only for this email notification .

Please suggest how should i achieve this .it is urgent please help .

6 REPLIES 6

can you try now

 

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
        /* Optional EmailOutbound */
        email, /* Optional GlideRecord */ email_action,
        /* Optional GlideRecord */
        event) {

	
	var gd =new GlideDateTime(current.starts);
	

	template.print("Date is "+ gd.getDate());
	
	template.print("\n Date with time "+ gd);

})(current, template, email, email_action, event);

 

Output:

 

find_real_file.png

 

 

Thanks, that worked. But, do you know how I can format it the same as it is in my User Profile which is MM-DD-yyyy ??

 

Thanks,

Brandon