formatting dates (and some dense code)