Is it possible to format the output of the date command?
Hello,
I would like to remove the timezone information from the message's date command. I tried with the original Linux commands, but without success.
Is there any way to do this?
e.g.:
Tue Dec 10 2024 10:00:13 GMT+0000 (Coordinated Universal Time) I want to remove "GMT+0000 (Coordinated Universal Time) "
Thank you in advance.
Hmm, well, this is how Node.js formats dates by default. The code isn't requesting the timezone, it just gets added automatically based on your locale:
https://github.com/jhuckaby/logalert/blob/master/index.js#L322
date: (new Date()).toString()
You can change this by setting the timezone on your server, however:
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
In a future release I can try to add macros that resolve to various date bits, so you can construct your own date/time string.