5 ms·
But "1000"<"999" in Python.
by oefnak 5y ago
But "1000"<"999" in Python.
- thomasfedb 5y agoBut the format and length for these numerical strings is fixed.
- jpambrun 5y agoThis is going to be a problem in about 8,000 years tho.
- laumars 5y agoString comparison works as long as you order your date time by significance and zero pad all values, which they were doing with their date stamp anyway. Plus if they weren’t then even numerical comparisons would fail eg 1012021 (Oct/1/2021) < 5102020 (May/10/2020) so you argument is moot.
- 6c696e7578 5y agoWouldn't it be done more like this though? "%04d%02d%02d" % (999,1,1)