     else
       magnitude = Math.pow 10, digits - sd
       Math.round(value * magnitude) / magnitude
+
+formatTime = d3.time.format '%Y-%m-%d %H:%M:%S'
+formatDateTime = (time) -> if time then formatTime new Date time else '-'
 
 formatReal = do ->
   __formatFunctions = {}

              column.domain.length
            else
              column[attribute]
        when 'real'
          switch attribute
            when 'cardinality'

          column.str_data[index] or '-'
        when 'enum'
          column.domain[column.data[index]]
        when 'time'
          formatDateTime column.data[index]
        else
          value = column.data[index]
          if value is 'NaN'
