         time.setUTCFullYear 1970
         time.setUTCMonth 0
         time.setUTCDate 1
-        time = (+time / 1000 + (parameter.value.nanosecondDelta ? 0)) * Math.pow 10, parameter.scale
+        time = (+time / 1000 + (parameter.value.nanosecondDelta ? 0)) * Math.pow 10, @resolveScale(parameter)
         
         offset = -parameter.value.getTimezoneOffset()
         
         # seconds since midnight
-        switch parameter.scale
+        switch @resolveScale(parameter)
           when 0, 1, 2
             buffer.writeUInt8 8
             buffer.writeUInt24LE time

        buffer.writeUInt8 17
      
      buffer.writeUInt8 parameter.precision
      buffer.writeUInt8 parameter.scale
    writeParameterData: (buffer, parameter) ->
      # ParamLenData (TYPE_VARBYTE)
      if parameter.value?
        sign = if parameter.value < 0 then 0 else 1
        value = Math.round Math.abs parameter.value * Math.pow(10, parameter.scale)

        if parameter.precision <= 9
          buffer.writeUInt8 5

        buffer.writeUInt8 17
      
      buffer.writeUInt8 parameter.precision
      buffer.writeUInt8 @resolveScale(parameter)
    writeParameterData: (buffer, parameter) ->
      # ParamLenData (TYPE_VARBYTE)
      if parameter.value?
        sign = if parameter.value < 0 then 0 else 1
        value = Math.round Math.abs parameter.value * Math.pow(10, @resolveScale(parameter))
        
        if parameter.precision <= 9
          buffer.writeUInt8 5
