Featured
-
How to split a String
Below I have written a code to split a string.
by shahbaz.ahmmod -
Send Push Notification with Custom Data to iPhone device from Java Server Side
This blog will help you to send Push Notifications
by babita.dhami -
Tomcat and Eclipse Integration Error : “Unknown version of Tomcat was specified”
If you are adding Server in Eclipse for Tomcat, an
by chandan.ahluwalia -
Spring MVC and MongoDB
Repository Class Using MongoDB : Spring has th
by sumit.vyas -
How to create DLL file from java?
Hello Guy's This Blog will guide how to create D
by bhagwan.khichar
Tags
Formatting date in different format in java
Formatting Date in java:
There is a predefined format for dealing with dates in java , but suppose if you want the date in some other format other than the default one then you can use the SimpleDateFormat class of the java.text ...
Printing current Date in Java
Date Class in java:
There is a Date class in java under java.util package which can be used to print the current dates. There can be various ways to print the current date. Lets see with the help of example:
import java.util.Date;
...
How to get year from a date in Java?
To get only year from a date you can use the below code. You can pass any date that you wan to change, I'm getting year from the date in the below example:
/**
* Get year from Date
*
* @param createDate
*...
How to get full date with time in Java?
To get the full date with time you can use the below code. You can pass any date that you wan to change, I'm getting date in full date format in the below example:
/**
* Get full month day year format from Da...
How to check a particular date is within past 24 hours or not?
Sometimes we need to check whether a date is within past 24 hours or not. Generally we implement this kind of functionality when we create an AuthToken or a code that we want to to be valid for some time duration.
Example: In the below example...