Using nodejs v18+
built-in datetime formatter, code are below
new Intl.DateimeFormat('fr', {
timezone: 'Asia/Taipei',
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
}).format(new Date('2024-10-24T10:00:03Z'))
print 2024-10-24 18:00:03
It can be used to server and serverless environment such as GCP cloudfunction
, …etc.