add require 'date'

fixes the error on line 161