JavaScript Date/Time functions not working in Run Code Action

Thanks for this answer! Did you also find a way to return a date with your run code block? I am trying to compare a date with a metafield of a order but I can not return a date. I tried to return a string but the metafield is a date and I can’t think of a way to convert that.