I need to get the day, month, year details from a Date value but getYear() is deprecated, gives year on 2 digits, and has problems with Y2K (2008 g
The workaround presented by Ashwin works and it's not that tricky. But I'd suggest using the date patterns instead of splitting:
For date -
DateTimeFormat.getFormat( "d" ).format( new Date() )
For month -
DateTimeFormat.getFormat( "M" ).format( new Date() )
For year -
DateTimeFormat.getFormat( "yyyy" ).format( new Date() )