Local Time vs GMT

Travis Michigan
Mega Sage

Is there a way to understand better how the system determines when to use Local Time vs GMT?  I'm afraid I don't see it but find it frustrating.   

 

When I was making a transform map, if I used the run script check box and the put in 

	var recentDiscovery = new GlideDateTime();
	target.last_discovered = recentDiscovery;

Then it would populate the field with local time (which is what I wanted) but what I would have preferred was to just have it in the field map below so if the next person found it then they would see the source field of script was populating last_discovered.  But when I tried to set a variable to the current GlideDateTime there it would set the time to GMT.

	var recentDiscovery = new GlideDateTime();
	return recentDiscovery;

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Travis Michigan
Mega Sage

So a coworker helped me.  The problem is that in one place when setting the target it was using the object.  For the second example of a specific field it was only passing in a string.  So the way we got the field to work properly was:

	var today = new GlideDateTime();
	var discovered = new GlideDateTime(today.getDisplayValue());
	return discovered; // return the value to be put into the target field

View solution in original post

1 REPLY 1

Travis Michigan
Mega Sage

So a coworker helped me.  The problem is that in one place when setting the target it was using the object.  For the second example of a specific field it was only passing in a string.  So the way we got the field to work properly was:

	var today = new GlideDateTime();
	var discovered = new GlideDateTime(today.getDisplayValue());
	return discovered; // return the value to be put into the target field