Here you can find the source of getNice(long timeMillisecGMT)
Parameter | Description |
---|---|
timeMillisecGMT | a parameter |
public static String getNice(long timeMillisecGMT)
//package com.java2s; /***************************************************************************** * Source code information//from w w w.jav a 2 s. co m * ----------------------- * Original author Luis Bermudez, SURA * Author email bermudez@sura.org * Package org.oostethys.netcdf.util * Web http://marinemetadata.org/mmitools * Created Dec 4, 2006 * Filename $RCSfile: TimeUtil.java,v $ * Revision $Revision: 1.2 $ * * Last modified on $Date: 2008/06/19 19:47:44 $ * by $Author: luisbermudez $ * * (c) Copyright 2005, 2006 Monterey Bay Aquarium Research Institute * Marine Metadata Interoperability (MMI) Project http://marinemetadata.org * * License Information * ------------------------ * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, you can download it from * http://marinementadata.org/gpl or write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *********************************************************************************/ import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { /** * Return nice given MMILIS since EPOCH * * @param timeMillisecGMT * @return */ public static String getNice(long timeMillisecGMT) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); format.setTimeZone(TimeZone.getTimeZone("GMT")); return format.format(new Date(timeMillisecGMT)); } }