Here you can find the source of getUtcTimestamp()
public static String getUtcTimestamp()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.*; public class Main { /**//from w ww .j av a 2 s .com * Request timestamp in ISO 8601 combined date and time in UTC. * * @return String timestamp Example: 2014-09-18T10:32:59Z */ public static String getUtcTimestamp() { SimpleDateFormat timeFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); timeFormatter.setTimeZone(new SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC")); return timeFormatter.format(new Date()); } }