Java 8

Top eBay Listing Design Company in Canada

Buy the best auction HTML eBay templates in just 10$ each. eBay Templates Sell Like You Mean It Take the guesswork out of creating a beautiful, sales-worthy eBay Template Order Now! SELL LIKE A PRO Fully Customizable eBay Templates Our template, your content. Customize your free eBay template to make the presentation you want. Mobile Responsive Design Our templates not only look great on mobile devices, but also provide a better user experience. Free Image Hosting Keep all your images organized in a single location. Up to 16 Slider Images Can’t choose...

Read more...

Java 8 – HijrahDate, How to calculate the Ramadan date

Ramadan is the 9th month of the Islamic calendar, the entire month. 1. HijrahDate -> Ramadan 2016 Full example to calculate the start and end of the Ramadan 2016TestHijrahDate.java package com.mkyong.date; import java.time.LocalDate; import java.time.chrono.HijrahDate; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAdjusters; public class TestDate { public static void main(String[] args) { //first day of Ramadan, 9th month HijrahDate ramadan = HijrahDate.now() ...

Read more...

Spring Data MongoDB + JSR-310 or Java 8 new Date APIs

While saving an object containing the new Java 8 java.time.LocalDateTime, the following error is thrown : org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.time.LocalDateTime] to type [java.util.Date] Tested Spring 4.3.2.RELEASESpring Data MongoDB 1.9.2.RELEASE Is Spring-data supporting the new Java 8 Date APIs (JSR-310)? 1. Spring Data + JSR-310 Yes, Spring-data supports the JSR-310 spec, with a custom convertor – Jsr310Converters, review the following code snippet :CustomConversions.java package org.springframework.data.mongodb.core.convert; public class CustomConversions { ...

Read more...

Java 8 – MinguoDate examples

This MinguoDate calendar system is primarily used in Taiwan (Republic of China…) (ISO) 1912-01-01 = 1-01-01 (Minguo ROC) To convert the current date to the Minguo date, just subtracts the current year with number 1911, for example 2016 (ISO) - 1911 = 105 (Minguo ROC) 1. LocalDate -> MinguoDate Review a full example to convert a LocalDate to MinguoDateTestMinguoDate.java package com.mkyong.date; import java.time.LocalDate; import java.time.chrono.MinguoDate; public class TestMinguoDate { public static void main(String[] args) { // LocalDate -> MinguoDate ...

Read more...

Java 8 – TemporalAdjusters examples

In Java 8, you can use the predefined java.time.temporal.TemporalAdjusters to adjust a date or Temporal 1. TemporalAdjusters Example to move a date to firstDayOfMonth, firstDayOfNextMonth, next Monday and etc.TestDate.java package com.mkyong.time; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.temporal.TemporalAdjusters; public class TestDate { public static void main(String[] args) { LocalDate localDate = LocalDate.now(); System.out.println("current date : " + localDate); LocalDate with = localDate.with(TemporalAdjusters.firstDayOfMonth()); ...

Read more...