Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java get year from date

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = format.parse(datetime);
SimpleDateFormat df = new SimpleDateFormat("yyyy");
year = df.format(date);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #year #date
ADD COMMENT
Topic
Name
8+3 =