rouchi.spam Posted October 9, 2014 Share Posted October 9, 2014 Hi everyone. I'm trying to create a form that retrieve values from a database. The database field has a date/time column that store values in unixtime format. The report created in jasper uses a calendar in witch we select Date and Time. I need a way to convert the values entered in the jasper calendar Date/Time to unixtime so i can build the sql query. The values entered in the calendar are convert to a weird format as can be seen in the pictures below. Link to comment Share on other sites More sharing options...
rajesh.sirsikar Posted October 12, 2014 Share Posted October 12, 2014 Hi,The way to convert a date into unixtime stamp is(Day difference from the date to 01/01/1970) x 86400 = UnixTimeThanks,Rajesh S Link to comment Share on other sites More sharing options...
djohnson53 Posted March 6, 2015 Share Posted March 6, 2015 There's an SQL function for this. FROM_UNIXTIME() will take a Unix timestamp and make it a Java compatible date. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now