Giter Club home page Giter Club logo

Comments (7)

9glenda avatar 9glenda commented on May 27, 2024 1

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.

fox91 avatar fox91 commented on May 27, 2024 1

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.

cafkafk avatar cafkafk commented on May 27, 2024 1
~/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.

cafkafk avatar cafkafk commented on May 27, 2024

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.

fox91 avatar fox91 commented on May 27, 2024

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.

erwinvaneijk avatar erwinvaneijk commented on May 27, 2024

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.

IzhakJakov avatar IzhakJakov commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.