Java Timestamp Format format2AdwordsTimestamp(Date date)

Here you can find the source of format2AdwordsTimestamp(Date date)

Description

format Adwords Timestamp

License

Open Source License

Declaration

public static String format2AdwordsTimestamp(Date date) 

Method Source Code

//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);
    }
}

Related

  1. format(final Date date)
  2. format(final long unixTimeStamp)
  3. format(long timestamp)
  4. format(long timeStamp)
  5. format(Timestamp time)
  6. format8chars(long timestamp)
  7. formataDataHoraMinuto(Timestamp dataHora)
  8. formatCalendar(Timestamp stamp)
  9. formatCurrentDateTimeStamp(final String dateFormatString)