Java Date to String dateToW3CDTF(Date date)

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

Description

date To WCDTF

License

Open Source License

Declaration

public static String dateToW3CDTF(Date date) 

Method Source Code

//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String dateToW3CDTF(Date date) {
        SimpleDateFormat w3cdtf = new SimpleDateFormat(
                "yyyy-MM-dd'T'HH:mm:ssZ");
        String s = w3cdtf.format(date);
        int index = s.length() - 2;
        return s.substring(0, index) + ":" + s.substring(index);
    }/*from  www.  ja v  a  2 s  .  c o m*/
}

Related

  1. dateToStringWithTime(Date date)
  2. dateToTimeString(Date date)
  3. dateToUTCDate(Date d)
  4. dateToUtcString(Date date)
  5. dateToW3c(Date d)
  6. dateToW3CDTF(Date date)
  7. dateToyyyyMMddHHmmss(Date date)