If you’re able to put that logic into some expression using the dateFormat()
or similar, those get outputted as java.util.Date
as well and are also immediately usable for system.db.runPrepQuery
. You would use a ?
in your query where you need the date, no formatting on your part required. I know this isn’t the main point of your question but personally I hate having to manually handle and touch dates so I avoid it whenever possible.