Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java how to get current date

import java.time.format.DateTimeFormatter;  
import java.time.LocalDateTime;    
public class CurrentDateTimeExample1 {    
  public static void main(String[] args) {    
   DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");  
   LocalDateTime now = LocalDateTime.now();  
   System.out.println(dtf.format(now));  
  }    
}   
Comment

java get current date string

String date = new SimpleDateFormat("dd-MM-yyyy").format(new Date());
Comment

java Date get today date

SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
Date today = new Date();
System.out.println(formatter.format(today));
Comment

java get current date

SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");  
Date date = new Date();  
System.out.println(formatter.format(date));  

// ------------------------

System.out.println(LocalDate.now()); 
Comment

get today date in java 8

LocalDate localDate = LocalDate.now();
Comment

how to get current date in java

long millis=System.currentTimeMillis();  
java.sql.Date date=new java.sql.Date(millis);  
System.out.println(date);
Comment

PREVIOUS NEXT
Code Example
Java :: when does lockdown end 
Java :: java 2d game tutorial 
Java :: localdatetime now + hours 
Java :: java custom color 
Java :: java parse string to list using gson 
Java :: android studio constrainglayout 
Java :: context path spring boot 
Java :: how to show full search bar in android studio 
Java :: java string lowercase 
Java :: absolute method in jdbc 
Java :: how to print arraylist 
Java :: Panel Slider for java swing 
Java :: actionlistener java 
Java :: show confirmation dialog java android 
Java :: jdbc maven dependency 
Java :: java execute funtions at same time 
Java :: best ascii art characters 
Java :: java array contains 
Java :: select class in selenium 
Java :: primefaces custom validate 
Java :: java split string on two or more spaces except for words in quotes 
Java :: how to test how many of one character is in a string java 
Java :: javafx filechooser specific file 
Java :: get value textfield java 
Java :: javafx textarea font size 
Java :: minecraft java 
Java :: array to array list 
Java :: java 8 group a collections by 2 property 
Java :: java string array 
Java :: how to add minutes in date in java 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =