- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2018 12:34 AM
Hi All,
Here i am trying to add 1 year and fetch result into u_next_verification_date. when i execute in the message it shows correct , but in the field value showing wrong.
Any help is highly appreciated.
Vass
When i update the record it is showing the correct date values in the message below.
But when i open the record and check the field value it showing wrong. (Highlighted field).
Also i wish the date value should be the blue rounded one hours/minutes/seconds.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2018 03:51 AM
Try Below Code,Its working fine
var gr = new GlideDateTime();
var gr1=gs.yearsAgo(-1);
var date= gr1.split(' ')[0];
var time=gr1.split(' ')[1];
var gd = new GlideDate();
gd.setValue(date);
date=gd.getByFormat('dd/MM/yyyy');
gr1=date+' '+time; //gr1 is your converted format
gs.addInfoMessage(gr1);
current.u_next_verification_date =gr1;
current.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2018 01:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2018 10:23 PM
Hi Archana,
PFB final code. Sorry for the delay
var nvd= new GlideDateTime(current.u_verification_date);
nvd.addYearsLocalTime(1);
var dt =new GlideDateTime(nvd).getDate().getByFormat("dd-MM-yyyy"); //Change as required
var ti = new GlideDateTime(nvd).getTime();
gs.addInfoMessage(dt+'---'+ti);
current.u_next_verification_date = dt+' '+ti;
Thanks
Srinivas.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2018 02:01 AM
What is shown in Info Message?
And, can you insert the below info on the top of all the code and check?
gs.addInfoMessage('ver date::'+current.u_verification_date);
gs.addInfoMessage('Glided ver date::'+new GlideDateTime(current.u_verification_date));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2018 02:58 AM
08-10-2019---1970-01-01 09:56:36
Thanks
VASS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2018 03:51 AM
Try Below Code,Its working fine
var gr = new GlideDateTime();
var gr1=gs.yearsAgo(-1);
var date= gr1.split(' ')[0];
var time=gr1.split(' ')[1];
var gd = new GlideDate();
gd.setValue(date);
date=gd.getByFormat('dd/MM/yyyy');
gr1=date+' '+time; //gr1 is your converted format
gs.addInfoMessage(gr1);
current.u_next_verification_date =gr1;
current.update();