I was reading about Date vs TimeStamp vs calendar? because I´m sending toprint a report this parameters:
startDate = 2018-01-01T00:00:00+00:00
endDate = 2018-01-01T00:00:00+00:00
And at the begining of my report y print this variables formated as DD-MM-yyyy.
<textField pattern="dd/MM/yyyy">
<reportElement x="0" y="0" width="102" height="30" uuid="a0865739-1233-463e-8f93-77f75024e9dc"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{startDay}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="204" y="0" width="102" height="30" uuid="ff76b864-ef55-4fcc-82d5-323c6291b7ed"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{endDay}]]></textFieldExpression>
</textField>
Execute in GMT+0
If I declare the parameter as Java.util.Date
I get 31-12-2017 23:00:00
But If I declarea the parameter as java.sql.Timestamp
I get 01-01-2018 00:00:00