Here you can find the source of getRFC3339String(Calendar timestamp)
Parameter | Description |
---|---|
timestamp | a timestamp as a Calendar |
public static String getRFC3339String(Calendar timestamp)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { /**/* w w w . j a va 2 s .c om*/ * Takes a timestamp as a Calendar and returns it as a String in RFC 3339 format. * * @param timestamp * a timestamp as a Calendar * @return the provided timestamp as a RFC 3339 string */ public static String getRFC3339String(Calendar timestamp) { // As of Java 7 this is possible /ib 03/13/2018 SimpleDateFormat rfc3339Formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); return rfc3339Formatter.format(timestamp.getTime()); } }