I have a timestamp textField called $F{Fecha}, and I want to get from it the day,month, and year. I've create 3 variables var1,var2,var3 and in their expressions I've put the following $F{Fecha}.getDay(), $F{Fecha}.getMonth(),$F{Fecha}.getYear(); it gives me in return a value but they're wrong values,ie if my date is 20120118 it returns me day=3, month=0,yearh=112.
How can I do to fix this? Thanks in advance.
PD. I'm using iReport 4.0.0
Here is a way to do it with Java expressions:
Day: new Integer($F{Fecha}.getDate())
Month: new Integer($F{Fecha}.getMonth()+1)
Year: new Integer($F{Fecha}.getYear()+1900)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With