Format Month in MMMM Format in Java

Samual Sam
Updated on 27-Jun-2020 13:29:42

318 Views

Set the month format as MMMM, while including the date-time format in SimpleDateFormat object.Firstly, set the date objectDate dt = new Date();Now, set the format for date-timeSimpleDateFormat dateFormat = new SimpleDateFormat("EEEE MMMM dd yyyy kk:mm:ss");Display the date with the format you wantdateFormat.format(dt)The following is an exampleExample Live Demoimport java.text.SimpleDateFormat; import java.util.Date; public class Demo {    public static void main(String[] argv) throws Exception {       Date dt = new Date();       SimpleDateFormat dateFormat;       dateFormat = new SimpleDateFormat("EEEE MMMM dd yyyy kk:mm:ss");       System.out.println(dateFormat.format(dt));    } }OutputThursday November 22 2018 11:45:14

Compare Date and Time Using After Method of Java Calendar

karthikeya Boyini
Updated on 27-Jun-2020 13:29:04

293 Views

The Calendar.after() method returns whether this Calendar's time is after the time represented by the specified Object.First, let us set a date which is after (future date) the current dateCalendar afterDate = Calendar.getInstance(); afterDate.set(Calendar.YEAR, 2025); afterDate.set(Calendar.MONTH, 05); afterDate.set(Calendar.DATE, 30);Here is our date, which is 11-22-2018Calendar currentDate = Calendar.getInstance();Now, use the after() method to compare both the dates as shown in the following exampleExample Live Demoimport java.util.Calendar; public class Demo {    public static void main(String[] args) {       Calendar afterDate = Calendar.getInstance();       afterDate.set(Calendar.YEAR, 2025);       afterDate.set(Calendar.MONTH, 05);       afterDate.set(Calendar.DATE, 30);     ... Read More

Significance of Dreams in Our Life

Rashmi Iyer
Updated on 27-Jun-2020 13:28:33

3K+ Views

Great leaders and entrepreneurs from Bill Gates to Steve Jobs, from Winston Churchill to Mahatma Gandhi had the courage to dream something. Every great movement in history has the dream and vision of these personalities recorded.Dreams can be understood as aspirations and ambitions of a person to achieve a target or a goal in life for at an individual level or for a social cause. To achieve success in true spirit in your life, dreams play a very significant role. It can be understood by the following points -Give Momentum To the LifeDreams help an individual get a purpose in ... Read More

URL Encode a String using NSString in iPhone

Smita Kapse
Updated on 27-Jun-2020 13:28:31

627 Views

When developing API based web applications we definitely need to interect with Multiple web services and URLs. The url may contain special character, search terms, queries, headers and many other things depending on the service we need. That’s why we need to have some kind of encoding so that the URL we are creating and the URL being called are same.To achieve the same with Objective C we can use −#import "NSString+URLEncoding.h" @implementation NSString (URLEncoding) -(NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding {    return (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,    (CFStringRef)self, NULL, (CFStringRef)@"!*'\"();:@&=+$, /?%#[]% ", CFStringConvertNSStringEncodingToEncoding(encoding)); } @endAnother way to achieve URL encoding in Objective C is ... Read More

Exit iPhone Application Gracefully

Nishtha Thakur
Updated on 27-Jun-2020 13:28:13

545 Views

There are times we would like to close our application due to some reason, for example if there is no internet connection and you’d like to kill the app, or any other reason according to the application. Though apple prefers not quitting the application, hence it is not supported in any of the applications.The only way to logically kill an iOS application is by pressing the home button. As soon as the home button is pressed, and the application exits the memory is freed up and cleaned.Still there are other ways to quit an application.exit − this command may be ... Read More

Compare Date Time Using before() Method of Java Calendar

karthikeya Boyini
Updated on 27-Jun-2020 13:27:44

221 Views

The Calendar.before() method returns whether this Calendar's time is before the time represented by the specified Object.First, let us set a date which is in the past (past date)Calendar beforeDate = Calendar.getInstance(); beforeDate.set(Calendar.YEAR, 2010); beforeDate.set(Calendar.MONTH, 05); beforeDate.set(Calendar.DATE, 30);Here is our date, which is 11-22-2018Calendar currentDate = Calendar.getInstance();Now, use the before() method to compare both the dates as shown in the following exampleExample Live Demoimport java.util.Calendar; public class Demo {    public static void main(String[] args) {       Calendar beforeDate = Calendar.getInstance();       beforeDate.set(Calendar.YEAR, 2010);       beforeDate.set(Calendar.MONTH, 05);       beforeDate.set(Calendar.DATE, 30);       ... Read More

ALE Pin in 8085 Microprocessor

George John
Updated on 27-Jun-2020 13:27:25

17K+ Views

Intel 8085 is an 8-bit microprocessor which has 16 address line for 16-bit address of a memory location. 8 higher order address bits are transferred through 8 bit lines out of this 16 address line while remaining lower order 8 bits of the address are sent through another 8 lines multiplexed with the 8-bit data lines. ALE (Address Enable Latch) is the control signal which is nothing but a positive going pulse generated when a new operation is started by microprocessor. So when pulse goes high means ALE=1, it makes address bus enable and when ALE=0, means low pulse makes ... Read More

I/O M Pin in 8085 Microprocessor

Arjun Thakur
Updated on 27-Jun-2020 13:26:57

3K+ Views

In Intel 8085 microprocessor I/O and memory operation are differentiated by IO/m` status signal.IO/M` stands for ‘input-output/memory`’. When IO/M` is logic 0, it means that the address sent out by the processor is for addressing a memory location. When IO/M` is logic 1, it means that the address sent out by the processor is for addressing an I/O port.Fig: Pin diagram of 8085Let us consider this following example and also the voltage level at IO/M* pin. If we consider instruction MVI E, ABH then it means that ABH will be moved or copied to the register E. And as a ... Read More

Programmer's View of 8085 Microprocessor

George John
Updated on 27-Jun-2020 13:26:27

369 Views

Intel 8085 receives 8-bit information on AD7-0 from memory or in-port which resides inside the microprocessor via“register”. A register is a group of flip-flops, where each flip-flop can store a bit of information. To store 8 bitsof information, the size of a register in 8085 has to be 8 bitsThe advantages of a register over a memory location is the contents of a register can be accessed much faster by the microprocessor, compared with the contents of a memory location.However, the disadvantages of a register over a memory location are as follows.If there are too many registers, they occupy a lot ... Read More

Increment a Date Using the Java Calendar Class

Samual Sam
Updated on 27-Jun-2020 13:26:13

320 Views

Import the following package for Calendar class in Javaimport java.util.Calendar;Firstly, create a Calendar object and display the current dateCalendar calendar = Calendar.getInstance(); System.out.println("Current Date = " + calendar.getTime());Now, let us increment the date using the add() method and Calendar.DATE constantcalendar.add(Calendar.DATE, 2);The following is the complete exampleExample Live Demoimport java.util.Calendar; public class Demo {    public static void main(String[] args) {       Calendar calendar = Calendar.getInstance();       System.out.println("Current Date = " + calendar.getTime());       // Incrementing date by 2       calendar.add(Calendar.DATE, 2);       System.out.println("Updated Date = " + calendar.getTime());    } }OutputCurrent ... Read More

Advertisements