How to store a date without the year component

database-design

I have to store climate (temperature) data for a few cities. This would mean that each city will have 365 values (ex: The value for Jan 1, is the average temperature for that city for all Jan 1 for 50 years (1955-2004).

Hence I am not at all concerned with year. How do I store the date in a date column? Do I store Jan 1 as Jan 1 2009 ( a non-leap year)? Or is there any better way out?

Best Answer

One idea:

Use "day of year", but offset

  • March 1st is 1
  • Feb 28th is 365
  • Feb 29th is 366