Thank you for your response. After reading the Run Code Action Limitations, found here, I realized JS date and time functions do not work entirely in Run Code.
I accomplished what I needed to by including the order creation time in the input and used that as my timestamp. Then I was able to calculate what I needed from there.
Input:
query{
order{
tags,
createdAt
}}
Code:
export default function main(input) {
const creationTime = input.order.createdAt;