Getting Unable to format 2021-02-26 using format string yyyy-MM-dd

John Vo1
Tera Guru

I'm getting Unable to format 2021-02-26 using format string yyyy-MM-dd  when trying to import a excel file.  I looked at my transform map and try to change the date format to yyyy-MM-dd it keeps reverting back to the default.

 

find_real_file.png

1 ACCEPTED SOLUTION

There was a client script that prevented me from changing it.

View solution in original post

7 REPLIES 7

Allen Andreas
Administrator
Administrator

Hi,

If you click that lightbulb, did you add your format there?

You'd also want to double-check the format in Excel, sometimes it's not really dashes (-), but (/), and appears as if it's dashes. So you'd want to verify that as well.

If there's no time for it, but it's transforming to a date/time field, then you'll want to consider using script on that field transform (so click the script checkbox), instead, and then converting it over to a GlideDateTime object, then returning that...such as, example:

var dte = source.date_field_name.toString();
var gdt = new GlideDateTime();
gdt.setValue(dte);
return gdt.getValue();

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Yes I've done that and hit save and it keeps reverting back to the default screenshot.  My excel format has -

Hi,

Please consider using "source script", as I've mentioned above.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Allen,

 

I don't see anything about source script.  What would go in that source script?