Dhrupal
Dhrupal

Reputation: 1873

Add 5.30 hours in date Object

My date object out put is 1.05 pm, and it should be 6.35 pm. How to convert gmt to gmt 5.30.

Please help!

Upvotes: 1

Views: 2857

Answers (1)

Ram kiran Pachigolla
Ram kiran Pachigolla

Reputation: 21191

Calendar cal = Calendar.getInstance(); // creates calendar
cal.setTime(new Date()); // sets calendar time/date=====> you can set your own date here
cal.add(Calendar.HOUR_OF_DAY, 5); // adds one hour
cal.add(Calendar.MINUTE, 30); // adds one Minute
cal.getTime(); // returns new date object, one hour in the future

=======> Setting time to calendar here

Upvotes: 6

Related Questions