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.

How to get use date in function field

samadam
Mega Sage

I am using function field and want to get just the date difference. I used the following and it returns the hours/minutes etc.

glidefunction:datediff(now(), start_date)

what can I use to replace now () to just get the date?

11 REPLIES 11

Can you tell me what are you trying to achieve so that I can help you more

 



Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

Kevin53
Tera Contributor

Please share your requirement then only I will be able to help you

 



Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

My requirement is to find the difference between today's date and start date. I have a function field that I am trying to use glidefunction. To get current date I tried to use now() but difference is returning in hours/seconds etc. Start date is just date. not datetime. I want the date difference in days/years no time.

JP - Kyndryl
Kilo Sage

Hi Samadam,

If your requirement is to set today's date in a custom field, you can do it like this:

 

JPKyndryl_0-1669833722832.png

 

 

Regards,
JP