Jump to content
We've recently updated our Privacy Statement, available here ×

migger

Members
  • Posts

    3
  • Joined

  • Last visited

migger's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Thanks Lucian! Your solution led me to solve this one, final solution was following: new java.sql.Timestamp($F{gps_datetime}.getTime()+$P{timeShift}.longValue()) Java Date object omits the clock time, so Timestamps was the one to use. Thanks again and hopefully this also helps someone else who has been fighting with the similar problem...
  2. Maybe I could, but there is no help for me since there is no "automatic conversion" for time in milleseconds (or seconds) since epoch to time in date (or timestamp) format. I would need a way to convert the time to date format with the added timezone offset. I think I can't do it with just pattern (I get error that I can't cast from long to date)? Or did I misunderstood your suggestion itchytoes? I did following: text field expression: ($F{gps_datetime}.getTime()+10800) expression class: java.util.date pattern: dd/MM/yyyy HH.mm.ss (it is not that important how it is precisely as long as I am able to convert from milliseconds to date format) And I got that Cannot cast from long to Date. Maybe I should create some variable to the report or something similar?
  3. Hi, I am trying to get localized time based on user's browser clock settings to my report. I am getting time offset from UI to server and can pass it with parameter to my template filling, but it seems I don't know how I could alter the timestamps I am fetching from the database with the offset. I have saved the timestamps in database in GMT time (java.sql.timestamp without timezone). Now I am able to do following (to text field expression): Long.valueOf(($F{gps_datetime}.getTime()+10800)) Which gives me the time in milliseconds with added offset (3 hours in this case), but I don't know how I could convert it back to YYYY-MM-DD HH:MM:SS format.
×
×
  • Create New...