Nuketown

On Dates, Dating and Cryptography

Posted in by Kenneth Newquist on Wed, 11/26/2003 - 2:00am

Time to geek out a bit. Ok, ok ... it's time to geek out a lot. Those of you who aren't interested in programming, Julian or Gregorian calendars or Neal Stephenson should probably stop reading now.



I'm working on a project at work where I have to select a bunch of dates from a MS SQL database. At first I thought I could do this using a similar "SELECT" statement, some date variables, and the database's two columns for "START_DATE" and "END_DATE".



But alas, these date columns were defined as "VARCHAR" rather than "DATE", meaning that MS SQL barfs if you try and compare the contents of the date columns to the actual date.



Very annoying.



But the self-same database does have the Julian start and end dates. It gave the year, followed by the number of days since the beginning of the year.



I have since come to realize that this is not the Julian date. I don't know what it's actually called, so I've taken to calling it the "quasi-julian" date. But more on that later.



After conferencing with a collegue, I decided to see if I could find something in PHP that would convert a date to the Julian date. I did a search on google for "PHP Julian Date Conversion" ... and landed at an online dating service. called "mega dating tips". Yes, that's right, a Web site offering advice on how to get a date.



After a long, frustrating morning of trying to trying to get data in and out of the database, this was just too much. I just sat back and laughed. And then laughed some more. And then I started searching again.



I found three pages of note: