0

Im trying to add 8 hours to the date I am getting from jasperstudio. The class type of the date im using is STRING. Does anyone know how to add hours from a date that is in string.

DATEFORMAT(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse($P{fromdate}) ,"MM-dd-yyyy HH:mm")

This is what I used in a text field but I dont know how to add hours. The date came from a MongoDB database that is -8hrs

Would it be best if I add it in my mongodb Query? How to add hours in ISO dateformat?

or make the calculation in jasperstudio?

Thank you!

Alex K
  • 22,315
  • 19
  • 108
  • 236

1 Answers1

-1

The best approach it to modify your MongoDB query to give what you want.

This is not a responsability for jasper since data needs to be transformed from MongoDB in your case.

Can you post your MongoDB Query (MQL)?

You can check this link to use $add aggregation: https://docs.mongodb.com/manual/reference/operator/aggregation/add/