Senin, 27 November 2017

How To Convert One Date Format To Another Date Format In Java?

How To Convert One Date Format To Another Date Format In Java?

Think about the desired date format. Date format can be several types like MMddyy, yyMMdd, dd/MM/yy etc. For example, we want the date format of yyMMdd. Create a SimpleDateFormat object and pass the desired date format. Use format method of SimpleDateFormat class to format the date. Declare a String variable and initialize it with the date string containing date in one format. 

Look carefully the format of the String. We must have to define the format into the SimpleDateFormat object during the object creation. For our example, the format is like MM/dd/yyyy. Now, create SimpleDateFormat object with source string date format. Using the parse method of SimpleDateFormat class, format the date string into Date object. Declare a String variable and initialize it with the date string containing date in one format. Look carefully the format of the String. We must have to define the format into the SimpleDateFormat object during the object creation.

For our example, the format is like MM/dd/yyyy. Now, create SimpleDateFormat object with source string date format. Using the parse method of SimpleDateFormat class, format the date string into Date object. Think about the desired date format. Date format can be several types like MMddyy, yyMMdd, dd/MM/yy etc. For example, we want the date format like yyMMdd. Use format method of SimpleDateFormat class to format the date. Write a Java program which could format the minutes like ss format in this way. For example if it is 1 second it will show 01 and if it is 12 second then it will show 12 i.e. it always shows 2 digit format of the date's time. Write a Java program which could format the day like dd format. For example if date is 8, it will show 08 and if it is 12, it will show 12 i.e. it always shows 2 digit format of the date's day. Write a Java program which could format the year like yyyy format. Sign in or sign up and post using a HubPages Network account. Post CommentNo HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites. What i was searching, I got more than that. This java codes are really helpful.

Display tag library - The display tag library is an open source suite of custom tags that provide high level web presentation patterns which will work in an MVC model. The library provides a significant amount of functionality while still being simple and straight-forward to use. Log4j - Log4j is a logging tool that allows you to log at runtime without modifying the application binary. 

The log4j package is designed so that logging statements can remain in shipped code without incurring a heavy performance cost. Logging behavior can be controlled by editing a configuration file, without touching the application binary. Columba - Columba is an Email Client written in Java, featuring a user-friendly graphical interface with wizards and internationalization support. Its a powerful email management tool with features to enhance your productivity and communication. JFTP - JFtp is a graphical Java network and file transfer client. QuickServer - QuickServer is a free, open source Java library for quick creation of robust and multi-threaded, multi-client TCP server applications.

With QuickServer one can just concentrate on just the application logic/protocol on hand. ProGuard - ProGuard is a free Java class file shrinker and obfuscator. It can detect and remove unused classes, fields, methods, and attributes. It can then rename the remaining classes, fields, and methods using short meaningless names. The resulting jars are smaller and harder to reverse-engineer. 

ANTLR provides excellent support for tree construction, tree walking, and translation. Text - iText is a library that allows you to generate PDF files on the fly. The iText classes are very useful for people who need to generate read-only, platform independent documents containing text, lists, tables and images. The library is especially useful in combination with Java technology-based Servlets: The look and feel of HTML is browser dependent; with iText and PDF you can control exactly how your servlet's output will look. Hibernate - Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java.



Tidak ada komentar:

Posting Komentar

Adbox