Advices for modeling facts, time hierarchies based on two conditions
You need a date dimension table, and it should look something like this:

create table calendar (
  date_id int primary key,
  name text not null unique,
  date_iso date unique,
  year smallint,
  quarter_of_year smallint,
  month_of_year smallint,
  day_of_year smallint,
  day_of_month smallint,
  fiscal_year smallint,
  quarter_of_fiscal_year smallint,
  month_of_fiscal_year smallint,
  ...

);


and insert data like this:

insert into calendar values 
(0, 'N/A', null, ...),
(20130703, '2013-07-03', '2013-07-03', 2013, 3, 7, 184, 3, ...),
(20130704, '2013-07-04', '2013-07-04', 2013, 3, 7, 185, 4, ...);


Notes:


use a smart key (with the date as the key, like 20130703) as the primary key for your date dimension, for easier fact table partitioning. this is the only time you should use a smart key in your warehouse. use meaningless surrogates otherwise. 
use a text 'name' field to allow for 'N/A' dates
you should have ONE date dimension table and your fact table date keys should all point to it
you should not include times in your date dimension table. Consider a time dimension table if you need to track times, with say minute granularity.