The CreatorCon Call for Content is officially open! Get started here.

Date formatting/conversion in transform map

kjmauriello-999
Giga Contributor

I am receiving xlsx files with dates that look like this 43364.13333 which should translate to this 2018-09-21 03:12:00 UTC.

I am having issues finding a way to convert the value to a date/time in ServiceNow.

I don't see any GlideDateTime functions that will do the conversion and have not been able to find any javascript functions either

Does anyone know the formula to convert 43364.13333 to this 2018-09-21 03:12:00, ServiceNow or Javascript?

Any assistance would be greatly appreciated.

5 REPLIES 5

Thanks for the suggestion:

When I change the field type to date all values are empty.

String just imports the decimal value as a string.

I have even made the assumption that the value is number of days since 1900 and scripted this:

var gdt = new GlideDateTime("1900-01-01 00:00:00");
gdt.addDaysUTC(43364);
gs.print(gdt.getDate());

It returns 9/23/2018 but should return 9/21/2018, close but not quite right.  I am wondering if this is the correct conversion but may be a leap year issue.