TZ=UTC not being applied in node server

Hey, apologies if this isn’t in a thread. I couldn’t find it, if there is one.

I’m having issues with my node server when running prebuild script that is meant to tell me the build time in UTC

 "prebuild": "TZ=UTC node ./scripts/prebuild.js",

Inside the script, it is running

new Date().toISOString()

For debugging also, I’ve set this environment variable in render settings. However, I see a 5hour -offset with the actual UTC time.

e.g I deploy at 10pm BST, but I see 2023-06-18T14:00:17.102Z when I should expect to see 2023-06-18T21:00:17.102Z

Is there a setting I need to set? or is TZ being ignored for a reason?

Hi,

UTC is the default timezone for Render instances, I’m not quite clear where you’re seeing the other timestamp.

Please could you share some specific details of the issue you are experiencing that may help us troubleshoot it with you, e.g. service name/ID, more complete logging/error messages, reproduction steps, etc.

If you don’t want to share these details on the community forum, please feel free to raise a ticket using the “Help” or “Contact Support” links while logged into the Dashboard.

Alan

Hey Alan,

Thanks for your reply, apologies I found my issue. It was pointing to the wrong path to read the build info from testing.

Thanks,
Jamie

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.