Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/users/strajt9/svita.cz/web/kyselo/lib/sparrow.php on line 196 Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/users/strajt9/svita.cz/web/kyselo/lib/sparrow.php on line 1169 Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/users/strajt9/svita.cz/web/kyselo/lib/sparrow.php on line 1169 severákova polívka

severákova polívka

asi zelňačka (mainly in czech)

(fork of http://severak.soup.io/)


severak 8.7.2020 14:54:38

Dates Float

In a lot of legacy code, I've come across "integer dates". It's a pretty common way to store dates in a compact format: an integer in the form "YYYYMMDD", e.g., 20200616 It's relatively compact, it remains human readable (unlike a Unix epoch). It's not too difficult to play with the modulus and rounding operators to pick it back into date parts, if you need to, though mostly we'd use something like this as an ID-like value, or for sorting. Thanks to Katie E I've learned about a new format: decimal years. The integer portion is the year, and the decimal portion is how far through that year you are, e.g. 2020.4547. This is frequently used in statistical modeling to manage time-series data. Once again, it's not meant to be parsed back into an actual date, but if you're careful, you can do it.


login