Add or subtract days, weeks, months, years on Java 8 Date

In this tutorial I am going to show you how to add days, weeks, months, years to a particular date in Java 8 or later. Similarly I will also show how to substract days, weeks, months, years from a particular date. The date is actually LocalDate API in Java 8 or later. The one of the important improvements in Java 8 date time API was introduced is thread safety. So date time API in Java 8 or later is thread safe and can be used in multi-threaded environment without applying…

Continue

What is the use of @Temporal annotation in JPA

Here you will know what is the use of @Temporal annotation in JPA. @Temporal is a JPA annotation and generally specified only for persistent fields or properties of type java.util.Date and java.util.Calendar. Generally you use @Temporal annotation on the date or calendar field in entity classes during table and Java class mapping where Hibernate is used as an ORM (Object Relational Mapping) framework. You won’t be able to apply @Temporal annotation on Java 8 date time API. If you try to use @Temporal annotation on Java 8 date time API then…

Continue

Future or Past Date in Java

Introduction This tutorial will show you how you can calculate future or past date in Java. The calculation is done on future date from a particular date to “plus a number of given days” or past date from a particular date to “minus a number of given days”. Future or past date calculation may be required for various purposes such as to calculate the age of a person on future date or on past date. Related Posts: https://www.roytuts.com/calculate-future-or-past-date-in-php/ Add or subtract days, weeks, months, years on Java 8 Date

Continue

Dynamically generate years in PHP

Here in this example I am going to show you how to generate years in PHP language. Sometimes we need to select year value from dropdown or select/option field and for that we hardcode the year values in HTML option fields. It may be cumbersome at the point when we want to add a new year value to the option field as the year value grows as the time progresses. It is also bad idea to go and update the source code every year to add the new year value. You may forget…

Continue

Create Date in Excel File using Apache POI in Java

Introduction In this example I will show you how to create date and put it in an excel file using Apache POI in Java language. I will show you how to build the project using both maven and gradle build tools. I will also show you how to create date using Java 8 or prior to Java 8 on java.util.Date and java.util.Calendar. The Apache POI is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft’s OLE 2 Compound…

Continue

HighChart using AJAX, Codeigniter

We know that highchart basically displays different statistical data on different chart types such as column chart, bar chart, line chart, pie chart etc. You can have a look at the URL http://www.highcharts.com/ for more information. You can integrate highchart with any server side tehnology but here I will show you how to integrate highchart with Codeigniter framework. This tutorial shows step by step so that we can understand how it happens. It displays the data for site visitors log in line chart. I have also put a calendar for…

Continue

Calculate Future or Past date in PHP

This tutorial will show you how can you calculate either future date from a particular date to “plus a number of given days” or past date from a particular date to “minus a number of given days”. Future or past date calculation may be required for various purposes such as to calculate the age of a person on future date or on past date. I will show you this calculation in PHP language. If you need to calculate in Java please read here https://www.roytuts.com/future-or-past-date-in-java/ We first need to setup an appropriate…

Continue

Codeigniter XChart Example

Introduction We know that xchart basically displays different statistical data on different chart types such as column chart, bar chart, line chart, pie chart etc. You can have a look at the URL http://tenxer.github.io/xcharts/ for more information. You can integrate xchart with any server side tehnology but here I will show you how to integrate xchart with Codeigniter framework. This tutorial shows step by step so that we can understand how it happens. It displays the data for site visitors log in line chart. I have also put a calendar…

Continue