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 how to get current time

import java.util.Calendar;
Date currentTime = Calendar.getInstance().getTime();
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 :: ranfom number between 1 to 100 java 
Java :: get intent not working in fragment 
Java :: bucket sort java 
Java :: java betrag 
Java :: transparent background android studio 
Java :: java random 6 digit number 
Java :: list to int array in java 8 
Java :: java cast duration to long 
Java :: array to map java7 
Java :: maven source option 5 is no longer supported use 7 or later 
Java :: bukkit scheduler 
Java :: java timestamp 
Java :: java create txt file 
Java :: reload zsh profile 
Java :: jbutton remove selection border 
Java :: resultset get value 
Java :: how to deselect radio button in java 
Java :: random processing 
Java :: java stream collect to string 
Java :: -Xlint:deprecation 
Java :: java unique id 
Java :: deque in java 
Java :: Example on: Getting the substring after the first occurrence of a separator in Java 
Java :: java replace all space with underscore 
Java :: bungeecord plugin add configs 
Java :: set vs list java 
Java :: address book java program to add edit and delete 
Java :: java swing jtable different color each row 
Java :: java transform hashmap to list 
Java :: java swing array of buttons 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =