Here you can find the source of calendarToSiteDataString(final Calendar cal)
Parameter | Description |
---|---|
cal | The calendar input to be converted to a date time string |
public static String calendarToSiteDataString(final Calendar cal)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static final SimpleDateFormat SIMPLE_DATE_FORMATTER2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss'Z'"); /**//from w w w . j a v a 2 s . c o m * Returns calendar as a formatted String (yyyy-MM-dd HH:mm:ss'Z') * * @param cal The calendar input to be converted to a date time string * @return The formatted date time string */ public static String calendarToSiteDataString(final Calendar cal) { return SIMPLE_DATE_FORMATTER2.format(new Date(cal.getTimeInMillis())); } }