Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to set mm-dd-yyyy value from string to date field

richam
Tera Expert

Hi all,

Need to some help to set value received in a string field with format mm-dd-yyyy to date field(not datetime field). Can anyone help here. I am setting this value in variable of catalog item.

Thanks in advance.

Richa

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Here you go. use this in a server side code



var usr= new GlideRecord('sys_user');


usr.get(gs.getUserID());


var gd=new GlideDate();


  gd.setDisplayValue(your date value);


  current.<your date field name>=gd.getByFormat(usr.getValue('date_format'));


View solution in original post

5 REPLIES 5

Abhinay Erra
Giga Sage

Glad you got your question answered.