Here you can find the source of format(long timeStamp)
Parameter | Description |
---|---|
timeStamp | a parameter |
public static String format(long timeStamp)
//package com.java2s; /*//from w w w .ja v a 2 s. c o m * Copyright (c) 2004-2005 Universite de Nantes (LINA) * Copyright (c) 2005-2006 France Telecom * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact: Pierre-Charles David <pcdavid@gmail.com> */ import java.text.SimpleDateFormat; import java.util.Date; public class Main { /** * The textual format used to represent timestamps. Conforms to ISO 8601. */ private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); /** * Formats a numeric timestamp into a textual representation. * * @param timeStamp * @return a string representation of the timestamp */ public static String format(long timeStamp) { return FORMAT.format(new Date(timeStamp)); } }