Here you can find the source of dateToW3c(Date d)
Parameter | Description |
---|---|
d | the Date |
public static String dateToW3c(Date d)
//package com.java2s; // compliance with the InfoGrid license. The InfoGrid license and important import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*w ww .j a va2s . c o m*/ * Date format to use for W3C. */ public static final SimpleDateFormat theW3cFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); /** * Convert a Date to a W3C String. * * @param d the Date * @return the String */ public static String dateToW3c(Date d) { String ret = theW3cFormat.format(d); return ret; } }