Variable expression (date field)

Dear all,

I have a datefield (field_2989) stored in database as unixtime. As I want to show that field in my report in dd-mm-yyyy format I use this query "select from_unixtime(field_2989, '%d-%m-%Y')". This works as expected, no problem at all.

I have defined a variable which pulls data from this field, but cannot figure how to write variable expression to format the result. All I am getting is unixtime integer, but not formatted date.

Anyone knows a solution to this?

Thanking in advance.

edink79's picture
Joined: Dec 11 2016 - 12:43pm
Last seen: 9 months 1 week ago

What is the classtype for this "from_unixtime(field_2989, '%d-%m-%Y')" field, and can you provide a screenshot of what is being returned?

jgust - 9 months 1 week ago

1 Answer:

You could try adding this into a text field -

new SimpleDateFormat("dd-MM-yyyy HH:mm").format($V{Your Variable})

luked's picture
1027
Joined: Jun 7 2018 - 3:38pm
Last seen: 5 months 1 week ago
Feedback