Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Get the first day of the current month in Java

LocalDate now = LocalDate.now();

LocalDate firstDay = now.with(TemporalAdjusters.firstDayOfMonth());
Comment

java first day of week

LocalDate now = LocalDate.now();

LocalDate firstDayOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
Comment

java get first day of the week

private static Date firstDayOfWeek(Date date) {
   Calendar calendar = Calendar.getInstance();
   calendar.setTime(date);
   calendar.set(Calendar.DAY_OF_WEEK, 1);
   return calendar.getTime();
}
Comment

PREVIOUS NEXT
Code Example
Java :: arraylist to array java 
Java :: how to get current date in java 
Java :: iterate through an arraylist java 
Java :: javac clear 
Java :: spring maven plugin 
Java :: get thumbnail from video in android 
Java :: java try and catch 
Java :: java instant from timestamp string 
Java :: synchronized java 
Java :: Java NoClassDefFoundError but class is there 
Java :: matrix multiplication javascrpt 
Java :: classcastexception in java 
Java :: how to format a double in java to 2 decimal places 
Java :: java random int between 2 numbers 
Java :: java inline conditional 
Java :: write files with FileOutPutStream java 
Java :: nested list java 
Java :: display in java 
Java :: how to go to next iteration of while loop java 
Java :: java input string with spaces 
Java :: how to give square in java 
Java :: java memory increase command 
Java :: java datatypes 
Java :: set spring context 
Java :: java print default options 
Java :: How to efficiently reverse a singly linked list, in Java? 
Java :: java stream and filter 
Java :: import java.lang.Math.*; 
Java :: how to get a character in java in ascii 
Java :: java netbeans textfield only numbers 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =