How to set a current year to the Service catalog variable

ragz
Tera Expert

Hi

How to set a current year to single line text variable in service catalog  ?

javascript:gs.now() is returning 07-31-2019 . But I need only current year 2019 .

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

Try using javascript: var gdt = new GlideDateTime(gs.nowDateTime());gdt.getYear();

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

 

View solution in original post

5 REPLIES 5

I found something that works:

var gdt = new GlideDateTime();gdt.getYearLocalTime()