Java-J2ee

Calendar or Date difference in Java – example difference in day, hour, minute and second

Java-J2ee

This example shows how to to get Calendar or Date difference in day, hour, minute and second using Java code. First, get the date in milliseconds for both of the date object and then get their difference. Finally divide it by …

Posted in Java-J2ee | Tagged | Leave a comment

Java – get calendar time of other time zone

Java-J2ee

Java java.util.TimeZone class represents time zones. We can do easy calendar arithmetic across time zones in conjunction with the java.util.Calendar class. Here is an example which prints all the available time zones: String TimeZoneIds[] = TimeZone.getAvailableIDs(); for (String zoneId: TimeZoneIds) { System.out.println(zoneId); } The below method …

Posted in Java-J2ee | Tagged | Leave a comment

How to convert decimal to binary in Java with Example

Java-J2ee

This tutorial explains how to Convert decimal value into binary value. Integer class of java.lang package contains a method toBinaryString() which takes a decimal int value as argument and returns binary String value. Here is the complete program. import java.io.BufferedReader; …

Posted in About us, Adobe Flex, Adobe flex2, C and Cpp, ColdFusion, CSS, Delphi, Dreamweaver, eCommerce, HTML, Java-J2ee, Marketing, Microsoft Asp.Net, MM Fusion, MS Access, MS Excel, MS Frontpage, MySQL, Perl and CGI, PHP, Prestshop, Python, Ruby on Rails, SEO, Uncategorized, Visual Basic, Web Design, XML | Leave a comment