Closed RickCogley closed 9 months ago
I think you can set the TZ
environment variable with the desired timezone.
If you mean on the build command like you showed me before, I did. But the template code doesn't pick that up automagically as far as I can tell.
It works fine to me:
deno task serve
TZ=Europe/Helsinki deno task serve
Figured it out. It was working on localhost
, but not after pushing to Netlify. The problem was, if you simply specify like TZ=Europe/Helsinki deno task serve
, I speculate that due to how Netlify (and maybe other build environments?) work, that isn't enough because of some kind of environment or sub-process spawning that is being done. However, if you "export" the TZ, so that it's fully available as an environment var like export TZ=Europe/Helsinki && deno task serve
, it works. Here's the code I used specifically, which works for both localhost
and up on Netlify:
{
"importMap": "./import_map.json",
"tasks": {
"lume": "export TZ='Asia/Tokyo' && echo \"import 'lume/cli.ts'\" | deno run --unstable -A -",
"build": "deno task lume",
"serve": "deno task lume -s"
},
"compilerOptions": {
"types": [
"lume/types.ts"
]
}
}
https://github.com/eSolia/help.esolia.pro/commit/11948f4acb33c733a69c717fae401f41f360ad42
Example in bash:
$ hoge="Hi"
$ echo $hoge
Hi
$ fuga="Bye"
$ export hoge
$ bash
bash-5.2$ echo $hoge
Hi
bash-5.2$ echo $fuga
bash-5.2$
Hi - I'm wondering if I can specify the timezone of the updated timestamp in the footer?
I notice it's possible in date-fns, but I don't know how to get it to work. https://date-fns.org/v3.2.0/docs/Time-Zones