Here you can find the source of date2str(Calendar c)
static private String date2str(Calendar c)
//package com.java2s; /*//from w w w . j av a2 s . co m * IRIS -- Intelligent Roadway Information System * Copyright (C) 2009-2016 Minnesota Department of Transportation * Copyright (C) 2014-2015 AHMCT, University of California * Copyright (C) 2016 California Department of Transportation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private final static String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss Z"; static private String date2str(Calendar c) { return new SimpleDateFormat(DATE_FORMAT).format(c.getTime()); } }