Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

what data type can be used for date, time and years when creating a table in servicenow?

Abdullahi
Tera Contributor
 
1 REPLY 1

Sumanth16
Kilo Patron
Hi, 

Below are the date fields which supported by ServiceNow:

Date and time field typesField type Dictionary XML type MySQL DB type

Date	glide_date	DATE
Date/Time	glide_date_time	DATETIME
Time	glide_time	DATETIME
Duration	glide_duration	DATETIME
Due date	due_date	DATETIME


To populate only year use below client script below:



var reg = /(19[6789]\d|20[01]\d)/ ;



var ans = g_form.getValue('fieldname');//replace with your field name



if(!reg.test(ans))



{



        alert('Please enter valid year');



}


**Please Hit Correct, Helpful or like,if you are satisfied with this response.



Thanks & Regards,

Sumanth Meda