Here you can find the source of format2AdwordsTimestamp(Date date)
public static String format2AdwordsTimestamp(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String format2AdwordsTimestamp(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date);// ww w.j ava 2 s . c o m c.add(Calendar.HOUR, -8); return format("yyyyMMdd HHmmss", c.getTime()) + " UTC"; } public static String format(String pattern, Date date) { SimpleDateFormat f = new SimpleDateFormat(pattern); return f.format(date); } }