Comments (7)
Eza should also be able to read from the TZ variable like Firefox for example does.
I'm not sure about rather /etc/timezone is the right place for this. I'd much prefer /etc/localtime
. NixOS for example hat no /etc/timezone
iirc.
Example usage for /etc/localtime
zdump /etc/localtime
freedesktop reference
Note
This is a systemd thing so maybe we want non systemd support
https://www.freedesktop.org/software/systemd/man/latest/localtime.html
from eza.
On Ubuntu there are both /etc/timezone
and /etc/localtime
, both valued with Europe/Rome
(on my system).
I know about the TZ
variable and I tried to use it but the result doesn't change (that's why I didn't include it in the original issue).
$ TZ=UTC eza -aglF --time-style full-iso
.rw-r--r-- 0 user group 2023-02-04 09:35:00.000000000 +0000 bar
.rw-r--r-- 0 user group 2023-06-04 08:35:00.000000000 +0000 baz
.rw-r--r-- 0 user group 2023-11-12 09:35:00.000000000 +0000 foo
$ TZ=Europe/Berlin eza -aglF --time-style full-iso
.rw-r--r-- 0 user group 2023-02-04 10:35:00.000000000 +0100 bar
.rw-r--r-- 0 user group 2023-06-04 09:35:00.000000000 +0100 baz
.rw-r--r-- 0 user group 2023-11-12 10:35:00.000000000 +0100 foo
TZ
is used by eza
but not correctly: it seems that the current offset is used throughout the year.
With the same TZ
values ls
and exa
behave correctly.
In macOS Sonoma (14.1.1
), which does not have /etc/timezone
but only /etc/localtime
, there is the same problem, same thing using TZ
while both ls
and exa
works.
from eza.
~/tz
✦ ❯ touch -d "2023-02-04 10:35:00" bar
~/tz
✦ ❯ touch -d "2023-06-04 10:35:00" baz
~/tz
✦ ❯ touch -d "2023-11-12 10:35:00" foo
~/tz
✦ ❯ TZ=Europe/Berlin eza -aglF --time-style full-iso bar baz foo
.rw-r--r-- 0 ces users 2023-02-04 10:35:00.000000000 +0100 bar
.rw-r--r-- 0 ces users 2023-06-04 09:35:00.000000000 +0100 baz
.rw-r--r-- 0 ces users 2023-11-12 10:35:00.000000000 +0100 foo
~/tz
✦ ❯ eza -aglF --time-style full-iso bar baz foo
.rw-r--r-- 0 ces users 2023-02-04 10:35:00.000000000 +0100 bar
.rw-r--r-- 0 ces users 2023-06-04 09:35:00.000000000 +0100 baz
.rw-r--r-- 0 ces users 2023-11-12 10:35:00.000000000 +0100 foo
Can reproduce.
from eza.
Interestingly for me on eza v0.15.1
on NixOS:
❯ zdump /etc/localtime
/etc/localtime Tue Nov 14 07:07:15 2023 CET
❯ eza -l testfile
.rw-r--r-- 0 ces 14 Nov 07:07 testfile
❯ eza -laglF --time-style full-iso testfile
.rw-r--r-- 0 ces users 2023-11-14 07:07:52.788969315 +0100 testfile
❯ echo "modification" >> testfile
❯ eza -laglF --time-style full-iso testfile
.rw-r--r-- 13 ces users 2023-11-14 07:09:53.656705263 +0100 testfile
from eza.
Interestingly for me on eza
v0.15.1
on NixOS:
Can you try with:
touch -d "2023-02-04 10:35:00" bar
touch -d "2023-06-04 10:35:00" baz
touch -d "2023-11-12 10:35:00" foo
TZ=Europe/Berlin eza -aglF --time-style full-iso bar baz foo
from eza.
The issue at hand here, seems to be that eza
sets the time_offset
once in the environment (output/table.rs: 351
), after which it is used everywhere. However, most timezones have daylight saving time, and when that applied at the time of the timestamp, have that offset used.
from eza.
I think this is similar to the issue I am having:
❯ touch -t 202110221528.27 development-values.yaml
❯ eza --long --time-style=long-iso development-values.yaml
.rw-r--r--@ 73 jizhak 2021-10-22 14:28 development-values.yaml
❯ ls --time-style='+%Y-%m-%d %H:%M' -l development-values.yaml
-rw-r--r-- 1 jizhak staff 73 2021-10-22 15:28 development-values.yaml
from eza.
Related Issues (20)
- Tab Does Not Show Autocomplete with ls Command HOT 2
- feat: make web versions of man page more easily discoverable HOT 1
- bug: pr template isn't auto-populated HOT 2
- Bug: `idump` give different output even without any modification, on Debian
- feat: Allow abbreviations for long option names HOT 1
- Wessss up on
- How to default -t to modified -r
- bug: Problems with man pages HOT 2
- feat: In tree view, the branch child contents should line up with the parent's first symbol
- bug: eza ignores LC_TIME and always shows dates in English (deb.gierens.de build only) HOT 7
- Apple Silicon Builds HOT 1
- feat: Plugin support HOT 3
- feat: dynamic navigation of tree HOT 1
- bug: unset permission bit "invisible", customizing color for that bit has no effect if unset
- bug: incorrect display of `eza -T --absolute /full/path` HOT 2
- feat: Formatted hyperlinks HOT 2
- Few eza icons different compared to exa icons
- feat: Allow skip check if dir is full or empty for icons
- feat: Adjustable Column Spacing
- bug: Different file sizes are shown by eza and ls commands HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eza.