james.miller_1 Posted November 16, 2018 Share Posted November 16, 2018 Hi, I have a quick question, i want to know if its possible to add a day onto a date if the time is later than a say 6pm. 1 parameter will be defaulted to a string thats set to "18:00". I want to throw this against my data (date column) and if the date/time on there is greater than the parameter thats set to "18:00" then add 1 day if its before that then it keeps the same day.Is this possible and how will it be acheived? Link to comment Share on other sites More sharing options...
akovach Posted November 22, 2018 Share Posted November 22, 2018 Hi James,you can get time part from date object with new SimpleDateFormat("HH:mm:ss").format("$F{date_field}"). Then compare it with your parameter. If true, in new variable or field add one day to field with: new DateUtils.AddDays("$F{date_field}", 1)Regards, 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