     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 = {}

              formatToSignificantDigits 6, column[attribute]
            else
              column[attribute]

        else # int
          switch attribute
            when 'cardinality'

              column.domain.length
            else
              column[attribute]
        when 'time'
          switch attribute
            when 'min', 'max', 'mean'
              formatDateTime column[attribute]
            when 'sigma'
              formatToSignificantDigits 6, column[attribute]
            when 'cardinality'
              '-'
            else
              column[attribute]
        when 'real'
          switch attribute
            when 'cardinality'
