0
/*********************Pay Button Listener***************************************/
	public class payListener implements ActionListener{
		public void actionPerformed(ActionEvent e) {
			
			replace();
			Ticket getNewPayTime = new Ticket();
			getNewPayTime.loadTicket(ticketIDNumber);
			paymentTime = Ticket.paymentTime; //getting correct ticket pyament time, correction performed by replace method. 
			
			long timeDifference = paymentTime - entranceTime;
			
			SimpleDateFormat sdf1 = new SimpleDateFormat("MMM dd,yyyy HH:mm");
			Date paymentdate = new Date (paymentTime);
			lPaymentTime.setText("Payment Time: " + sdf1.format(paymentdate));
			SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm");
			Date resultdate = new Date(timeDifference); 
			lTimeDifference.setText("Duration: " + sdf2.format(resultdate));
			
			
			
			
			}
		}
	/*********************Pay Button Listener***************************************/

in the line

SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm");

how do i print time in hh:mm:ss format?

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by NormR1
0

also my duration isnt correct, showing hours when there are no hours passed and its just minutes?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.