In the Calculator transform there are many operations to get and modify the various parts of a Date (year, month, day of month, day of week, etc.), ma no operation to get a Date object from its parts (year, month, day of month).
It could be useful to add an operation like "Create Date from Year A, Month B and Day of month C": the time part can be defaulted to midnight (and then modified with the already existing operations "Date A + B hours/minutes/seconds").
The current workaround consists in using a User Defined Java Expression transform, and create a field of type Date with an expression like:
new java.util.GregorianCalendar(YEAR_FIELD, MONTH_FIELD - 1, DAY_OF_MONTH_FIELD).getTime()(beware of the -1 in the month field!)
What would you like to happen?
In the Calculator transform there are many operations to get and modify the various parts of a Date (year, month, day of month, day of week, etc.), ma no operation to get a Date object from its parts (year, month, day of month).
It could be useful to add an operation like "Create Date from Year A, Month B and Day of month C": the time part can be defaulted to midnight (and then modified with the already existing operations "Date A + B hours/minutes/seconds").
The current workaround consists in using a User Defined Java Expression transform, and create a field of type
Date
with an expression like:new java.util.GregorianCalendar(YEAR_FIELD, MONTH_FIELD - 1, DAY_OF_MONTH_FIELD).getTime()
(beware of the -1 in the month field!)Issue Priority
Priority: 3
Issue Component
Component: Hop Gui, Component: Transforms