07-27-2020 07:27 AM
Hi ,
I am trying to convert a local-date-time format to dd-MMM-yy ( say for eg :13-NOV-19).
I tried various methods still could not achieve this . It could be useful if I have a method to achieve this
Thanks in advance
02-03-2022 08:25 AM
As an alternative to writing/reading a JSON file, try this (or similar expression as-needed) in your mapper using the JSON parse() and stringify() in combination:
JSON.parse(JSON.stringify($LAST_RUN_DATE))
or
JSON.parse(JSON.stringify($LAST_RUN_DATE.Timestamp))
While I don’t have access to the Snowflake Timestamp_NTZ type to test, I’ve tested this on a SQL Server DateTime2 field (which is also an incompatible local-date-time) and it converts its value to a string type.
02-04-2022 05:41 AM
Thanks for this suggestion.
One thing I uncovered, and I can’t believe it wasn’t mentioned to me, but was on the Snowflake Select snap, the Handle Timestamp and Date Time Data option. I hadn’t seen that and when I selected the SnapLogic Date Time format in Regional Time Zone option, the $LAST_RUN_DATE field would come as a single field and not put the .Timestamp in a sub-object. Ugh. This was a painful lesson.