Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

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

Abdullahi
Tera Contributor
 
1 REPLY 1

Sumanth16
Mega 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