SyntaxFix
Write A Post
Hire A Developer
Questions
Use date format
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = format.parse(datetime); SimpleDateFormat df = new SimpleDateFormat("yyyy"); year = df.format(date);