Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- publicString formatDateAsUTC(Date date) {
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(date);
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss'Z'");
- sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
- return sdf.format(date);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement