- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2014 01:27 PM
When importing expirydate from LDAP to sys_user table - I am obtaining an incorrect date. If user expiry date in Active directory is 31/12/2014 the date being displayed on the user form on ServiceNow is 01/01/2015 I was told that It is being imported on GMT and I need to convert it to EST. Can I do it directly on the date field?
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2014 06:24 AM
It will only affect that one particular variable and field. Your script is not quite right though as you need to modify the timezone for your gDate variable. You need to put:
//converting GMT to Canada/Eastern
var tz = Packages.java.util.TimeZone.getTimeZone("Canada/Eastern");
gDate.setTZ(tz);
...right after you initialize the variable and before you assign the date to it. You should end up with:
var gDate = Packages.com.glide.glideobject.GlideDateTime();
//converting GMT to Canada/Eastern
var tz = Packages.java.util.TimeZone.getTimeZone("Canada/Eastern");
gDate.setTZ(tz);
gDate.setValue(msDate);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2014 10:53 PM
target.date= gdt.getDisplayValue();
make use of thei
Make use of this line of code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2014 12:13 PM
Chandan,
Do you mean instead of target.u_expiry_date=";
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2014 11:19 PM
Yes, target.u_expire_date = gdt.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2016 11:53 AM
It Works!!
Just add date_field.getDisplayValue() which gives you actual date/time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2014 09:49 PM
Did you ever solve this?