Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.TimeZone; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String now() { TimeZone tz = TimeZone.getTimeZone("UTC"); DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); df.setTimeZone(tz); return df.format(new Date()); } }