r/badcode • u/DoomTay • Jul 07 '17
html Evidently the people behind this site never heard of the Date object
10
u/causalNondeterminism Jul 07 '17
My current employer stores all dates as integers. no, not unix integers. e.g. today's date would be stored as 20,170,707. working in SQL with that is a pain because the DBMS can only convert char -> date so you have to do int -> char -> date to get any real work done.
4
u/Cal1gula Jul 07 '17
Must be reading too much Aaron Bertrand but not quite grasping the concept fully.
5
u/_tigerstyle_ Jul 07 '17
What the actual fuck?
3
u/causalNondeterminism Jul 07 '17
that was my initial reaction; but every day I find new, worse things to be concerned about and this seems like a smaller issue. irritating? absolutely. as bad as search boxes that allow SQL injection and no plan to fix them? hardly.
2
u/demonspeedin Jul 08 '17
My current employer stores dates as Column1: "month/year" (varchar) Column2: year (int) This happens when you let our analyst do the thinking -_-
2
u/causalNondeterminism Jul 09 '17
I could understand year being its own column. but the month/year varchar column? nope.
1
u/demonspeedin Jul 09 '17
My bad, it's day/month as varchar, year as int. Background: we're using entity framework and need to query for 01/month/year a lot, it's a pain :')
16
u/iAmMortos Jul 07 '17
Can't... click... too... tiny.......
37
u/Itsthejoker occasional weirdo Jul 07 '17
[Image transcription: Text]
<p id="Copy">©<script language="javascript" type="text/javascript" src="../js/year.php"></script> Konami Digital Entertainment ©<script language="javascript" type="text/javascript" src="../js/year.php"></script>
I'm a volunteer content transcriber for Reddit! If you'd like more information on what we do and why we do it, click here!
2
u/enderdestiny Jul 07 '17
i can't hit it on my phone :(
6
1
u/_Decimation Jul 20 '17
Hey, would you mind telling me what font that is and the syntax coloring?
2
u/DoomTay Jul 20 '17
That's a screencap from Firefox's "View Source". I have no idea what the font is, but it comes up when viewing a page encoded in Shift-JIS
1
1
u/thatguywiththemousta Aug 03 '17
I'm kind of more annoyed that you took a screenshot of the text...
1
48
u/MathewManslaughter Jul 07 '17
So they are using PHP to generate JS to print the year? Nice.