Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java get current year

import java.util.Calendar;

int year = Calendar.getInstance().get(Calendar.YEAR);
Comment

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);
Comment

java get year

import java.time.ZoneId;
import java.util.Date;

new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().getYear();
Comment

java get year


int year = Calendar.getInstance().get(Calendar.YEAR);

Comment

PREVIOUS NEXT
Code Example
Java :: spring jpa repository gradle 
Java :: getcolor deprecated 
Java :: import android.support.v7.app.ActionBarActivity; 
Java :: save map to file java 
Java :: rgb to hex java 
Java :: java read file to string 
Java :: string to date conversion java 
Java :: how to loop through code 3 times java 
Java :: phone call using intent in Android 
Java :: calculate age in days java 
Java :: seconds to hours java 
Java :: flutter Uri toString and String to Uri 
Java :: hello word java 
Java :: string to double java exception 
Java :: transparent background android studio 
Java :: java count files in folder 
Java :: array to map java4 
Java :: import androidx.core.util.ArraySet; ^ symbol: class ArraySet location: package androidx.core.util 
Java :: servlet redirect java 
Java :: take a value from keyboard java 
Java :: init cap java 
Java :: android ancestral navigation 
Java :: java how to get elapsedTime 
Java :: check if map contains key java 
Java :: java how to open a link 
Java :: jakkala siva venkata deepesh 
Java :: How to generate all possible k combinations of numbers between 1 and n, in Java? 
Java :: intent android open activity 
Java :: java get amount of enums 
Java :: android run background service on startup 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =