3 Replies Latest reply on Nov 2, 2006 1:08 PM by Stefan_K.

    JavaCast ignoring type attribute

    ProphecyVI
      I have a vendor Java object that returns a long representation of a timestamp. Unfortunately for me, this long has to be multiplied by 1000 before it becomes the correct timestamp. Attempting to do so throws an error in MX 7 about integers, even though I'm casting everything to longs. Is there either a way to work around this, or a different way to get a timestamp from a long?

      Error thrown:

      Could not convert the value 1.162484964E12 to an integer because it cannot fit inside an integer.

      Code:

      lngStartTime = JavaCast("long", Request.varName.getStartTime());
      lngStartTime = JavaCast("long", lngStartTime * JavaCast("long", 1000)); //error thrown here
      dteStartTime = CreateObject("java", "java.sql.Timestamp");
      dteStartTime.init(lngStartTime);