Java Date RFC Format translateStartTimeToRFC3339(String startTime)

Here you can find the source of translateStartTimeToRFC3339(String startTime)

Description

translate Start Time To RFC

License

Apache License

Declaration

public static String translateStartTimeToRFC3339(String startTime)
            throws ParseException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    public static String translateStartTimeToRFC3339(String startTime)
            throws ParseException {
        SimpleDateFormat srcParser = new SimpleDateFormat(
                "YYYY-MM-DD'T'HH:mm:ss'Z'");
        SimpleDateFormat dstFormater = new SimpleDateFormat(
                "YYYY-MM-DD'T'HH:mm:ssXXX");
        Date date = srcParser.parse(startTime);
        return dstFormater.format(date);
    }//from w  ww.  j  a  v a 2s .c o m
}

Related

  1. rfc822Date(Date date)
  2. rfc822Date(final Date val)
  3. RFC822Section5Format_to_Date(String time)
  4. toRfc822(Calendar cal)
  5. toRFC822Date(Date date)