lsd-rs / lsd

The next gen ls command
Apache License 2.0
12.8k stars 413 forks source link

Date formatted value doesn't work #1039

Open pwsandoval opened 2 months ago

pwsandoval commented 2 months ago

Actual behavior

I have installed in two pc's (same lsd version, same powershell version, same fonts, same configs, etc.), with the same date string config date: "+%d-%m-%Y %I:%M %P" in one return 13-03-2024 12:13 pm (I want) and in the other 13-03-2024 12:13 (without pm or am)

PC 1 (correct) Screenshot_7

PC 2 (incorrect) Screenshot_1

Expected behavior

Same date in two outputs.

junghyuneun commented 2 months ago

just curious, do they have same locale values like time zone, etc? isn't one's LC_TYPE=C and the other one's LC_TYPE=utf-8 or sth?

pwsandoval commented 2 months ago

just curious, do they have same locale values like time zone, etc? isn't one's LC_TYPE=C and the other one's LC_TYPE=utf-8 or sth?

I use Windows PowerShell, I understand that it is an environment variable, but I don't have it set on either computer, should I do it?

Or can a lsd configuration level be solved?

junghyuneun commented 2 months ago

I think this problem might be related to how ‘lsd‘ creates the date time string using each user's locale, because from what i understand not all locales have am or pm (some might just have an empty string).

And since your two computer was set up identically I was wondering if those env variables (windows language? Location? Windows version? Etc) were different by any chance.

I'm not affiliated with this project at all but since I got curious I'll take a look. And it is highly likely that it has nothing to do with locale lol.

junghyuneun commented 2 months ago

Different implementations and libraries of C also might have undefined behavior regarding %P so make sure that the source and the version of your C is also same? Tho i don't think the problem would lie this deep

pwsandoval commented 2 months ago

Different implementations and libraries of C also might have undefined behavior regarding %P so make sure that the source and the version of your C is also same? Tho i don't think the problem would lie this deep

Thanks for the interest, I check the region settings and they both have the same:

Screenshot_5

I have also noticed in my screenshots that one shows some file different color such as README and LICENSE (where the date is not shown well) when it should be white