- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
Samual Sam
93 Views
For default format, use −DateFormat.getDateInstance(DateFormat.DEFAULT)To parse the string date value, use the parse() methodDate dt = DateFormat.getDateInstance(DateFormat.DEFAULT).parse("Nov 19, 2018");The following is an example −Example Live Demoimport java.text.DateFormat; import java.util.Date; public class Demo { public static void main(String[] argv) throws Exception { // parse date ... Read More
Samual Sam
2K+ Views
Firstly, import the following Java packages −import java.text.SimpleDateFormat; import java.util.Date;Now, create objects −Date dt = new Date(); SimpleDateFormat dateFormat;Displaying date in the format we wantdateFormat = new SimpleDateFormat("E MMM dd yyyy");The following is an example −Example Live Demoimport java.text.SimpleDateFormat; import java.util.Date; public class Demo { public static void main(String args[]) ... Read More
Samual Sam
88 Views
This property specifies a sound to be played as a background while an element's content is spoken. Possible values could be any of the followings −URI − The sound designated by this is played as a background while the element's content is spoken.mix − When present, this keyword means ... Read More
Samual Sam
159 Views
To implement Flip Out X Animation effect with CSS, you can try to run the following code −ExampleLive Demo .animated { background-image: url(/css/images/logo.png); background-repeat: no-repeat; ... Read More
Samual Sam
288 Views
For GregorianCalendar class, import the following package.import java.util.GregorianCalendar;Create an object.GregorianCalendar calendar = new GregorianCalendar();To get the day of the week, use the following field.GregorianCalendar.DAY_OF_WEEKThe following is an example.Example Live Demoimport java.util.Calendar; import java.util.GregorianCalendar; public class Demo { public static void main(String[] a) { GregorianCalendar calendar = new ... Read More
Samual Sam
114 Views
For GregorianCalendar class, import the following package.import java.util.GregorianCalendar;Create an object.GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance();Now, use the following field and add() method with a negative one (-1) to display the previous year.cal.add((GregorianCalendar.YEAR), -1)Example Live Demoimport java.util.Calendar; import java.util.GregorianCalendar; public class Demo { public static void main(String[] a) { ... Read More
Samual Sam
153 Views
To get the time format, use the DateFormat class and create a new object.DateFormat dateFormatter = new SimpleDateFormat("hh.mm.ss a");Now, parse the time.dateFormatter.parse("12.55.20 PM");Example Live Demoimport java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static void main(String[] argv) throws Exception { DateFormat dateFormatter = new SimpleDateFormat("hh.mm.ss ... Read More
Samual Sam
1K+ Views
GregorianCalendar is a hybrid calendar that supports both the Julian and Gregorian calendar systems with the support of a single discontinuity, which corresponds by default to the Gregorian date when the Gregorian calendar was instituted.The java.util.GregorianCalendar class in Java is a concrete subclass of Calendar and provides the standard calendar ... Read More
Samual Sam
2K+ Views
To work with the GregorianCalendar class, import the following package.import java.util.GregorianCalendar;Create a Date object.Date d = new Date();Now, create an object and set the time using the setTime() method.GregorianCalendar cal = new GregorianCalendar(); cal.setTime(d);The following is an example.Example Live Demoimport java.util.Date; import java.util.GregorianCalendar; public class Demo { public static void ... Read More
Samual Sam
13K+ Views
The getActualMaximum() method returns the maximum value that the specified calendar field could have, based on the time value of this Calendar.Import the following package to work with Calendar class in Java, import java.util.Calendar;Create a calendar object.Calendar cal = Calendar.getInstance();Use the getActualMaximum() method to get the last day of the ... Read More