Jump to content

UNIXTIME Conversion in iReport


scott1714

Recommended Posts

Hi -

MySQL, iReport 3.5

I have been Gogoling and searching this forum all day trying to convert unixtime into something ledgible for users.

I have tried FROM_UNIXTIME but the field is integer so it returns only 2009 for all dates.

Trying to format this using DATE_FORMAT(date, '%M %e, %Y, %l:%i%p') etc... but this pulls an error of "Cannot Cast from Interger to String". I also tried various nestings of CONVERT and CAST.

I am new to iReport and any assistance with this would be most welcome.

Kind regards,

Scott

 


 

 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

New here...looks like I put this in the wrong forum.

 

I changed the field descriptor to "java.lang.String" and then used:

 

Cast(date_format(FROM_UNIXTIME(date), '%Y-%m-%d') as CHAR) AS date to get what I needed.

 

Please move or delete.

 

Kind regards,

Scott

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...