Using Java 1.5 or older what would be the best way to convert a time given in 05-Aug-15 11:30 PM BST to 2015-08-06 18:53:50Z.
The code I have is as follows:
String ts = "05-Aug-15 11:30 PM BST";
DateFormat df1 = new SimpleDateFormat("dd-MMM-yy HH:mm aa z");
Date myDate = df1.parse(ts);
String myd = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(myDate);
System.out.println(myd);
2015-08-05T11:30:00Z
Is this the correct way to get from what is BST to UTC/Zulu.
Another issue is that the origional time is in 12:00 AM/PM but I would like to have it in 24h. This is what I get:
05-Aug-15 10:30 PM BST New Date:2015-08-05T10:30:00Z
05-Aug-15 10:30 AM BST New Date:2015-08-05T10:30:00Z