ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.69k stars 624 forks source link

[GoldSource / Source - Bug] not Middle-endian date format is not supported #420

Open ghost opened 11 years ago

ghost commented 11 years ago

It's very common problem in GoldSource / Source games. I've seen it in TeamFortress 2 and I see it in CS 1.6:

In USA date format is Middle-endian, starting with month (Month-Day-Year) - M/d/yyyy, 12-hour clock:

In India, Latin America, Asia (Central, SE, West), most of Europe, North Africa, Australia it's Gregorian little-endian, starting with day (Day-Month-Year) - dd.MM.yyyy:

There's also "China" format: Gregorian big-endian, starting with year (Year-Month-Day) - yyyy/M/d:

As you can see, if date format is not "M/d/yyyy" you don't see it.

You can test it yourself. Go to "Control Panel -> Region and Language -> select Format"

ghost commented 11 years ago

You could use OS API to manage dates: http://msdn.microsoft.com/en-us/goglobal/bb688124.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/dd318101(v=vs.85).aspx another way is to force USA date format everywhere http://msdn.microsoft.com/en-us/library/x99tb11d(VS.71).aspx

johndrinkwater commented 11 years ago

Force USA date ? :( goldsrc could use system date format, or fallback could be onto a more technical yet non-confusing format, ISO 8601, YYYY-MM-DD

ghost commented 11 years ago

They're not fixing it since 1998. I hope it will be at least forced to one standart, because it's better than don't be able to see dates at all

ghost commented 11 years ago

http://en.wikipedia.org/wiki/Date_format_by_country#Map

ghost commented 11 years ago

I checked, it's actually almost fixed in TF2 image (I wasn't able to see correct Hire Date before) image

image

SamVanheer commented 5 years ago

Seems to be working, it's displaying my local format properly (nl-BE):

history date format

Though it does not specify if it's AM or PM (PM in this case).

kisak-valve commented 5 years ago

Closing per the last comment and because the user has turned into a ghost.

metita commented 5 years ago

This is indeed not fixed.

I added a issue a few days ago too: #2290

imagen

SamVanheer commented 5 years ago

@kisak-valve Issue needs to be reopened.

The formatted date string is converted to lowercase, perhaps ::tolower is garbling UTF characters.

If that's not it perhaps using wcsftime and using KeyValues::SetWString could solve it. If the function itself is failing to format the string then the wide character version might be able to succeed there.

Failing that it's probably an issue with the font used in the server browser.

@basuritashka which locale do you have? This would be very useful information to have for testing.

metita commented 5 years ago

I added that info on #2290, I think that's enough.

It is because our days are like this: miércoles or sábado

kisak-valve commented 5 years ago

If this issue and #2290 are for the same issue, then we need to decide which one to keep open. Usually the older issue report is preferred. If this is not the case, please explain how they are different.

metita commented 5 years ago

They are related, but I think #2290 is related to UTF-8 character and this one seems to be a format one.