In this example I am going to show you how to check if an input date is past date or today’s date or future date. I am using Java version 12 and for this example you should use at least Java version 8. Java 8 or higher version provides thread safe version of date time API that can be used safely in multi-threaded environment. If you want to calculate the future or past date by adding or removing days to the input or given date then you can read the…
ContinueTag: Date
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…
ContinueWhat 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…
ContinueFuture 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://roytuts.com/calculate-future-or-past-date-in-php/ Add or subtract days, weeks, months, years on Java 8 Date
ContinueDynamically generate months in PHP
Sometimes we need to select month value from drop-down and for that we hardcode the month values in HTML option fields. It is possible to dynamically generate the month values using PHP and we can use those generated month values in HTML select option tag. You may also read Dynamically generate years in PHP
ContinueDynamically 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…
ContinueCreate 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…
ContinueHighChart using AJAX, Codeigniter
It is known that high chart 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 minimum and maximum temperatures in line chart.
ContinueCalculate 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://roytuts.com/future-or-past-date-in-java/ You first need to setup an appropriate…
ContinueCodeigniter 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