lsd icon indicating copy to clipboard operation
lsd copied to clipboard

Date formatted value doesn't work

Open pwsandoval opened this issue 9 months ago • 5 comments

  • os: Windows 11
  • lsd --version: 1.1.2
  • echo $TERM: nothing
  • echo $LS_COLORS: no configured

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.

pwsandoval avatar Apr 30 '24 06:04 pwsandoval

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?

junghyuneun avatar Apr 30 '24 20:04 junghyuneun

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?

pwsandoval avatar Apr 30 '24 23:04 pwsandoval

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 avatar Apr 30 '24 23:04 junghyuneun

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

junghyuneun avatar Apr 30 '24 23:04 junghyuneun

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

pwsandoval avatar Apr 30 '24 23:04 pwsandoval