Here you can find the source of formatDate(long absTime)
Parameter | Description |
---|---|
absTime | a parameter |
public static String formatDate(long absTime)
//package com.java2s; /***************************************************************************** * Copyright (c) 2007, 2008 Intel Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from ww w.j a v a 2 s . c o m*/ * Intel Corporation - Initial API and implementation * Ruslan A. Scherbakov, Intel - Initial API and implementation * Alvaro Sanchex-Leon - Udpated for TMF * * $Id: Utils.java,v 1.11 2008/06/16 21:04:49 jkubasta Exp $ *****************************************************************************/ import java.text.SimpleDateFormat; import java.util.Date; public class Main { static private final SimpleDateFormat sdateformat = new SimpleDateFormat("yyyy-MM-dd"); /** * From input time in nanoseconds, convert to Date format YYYY-MM-dd * * @param absTime * @return */ public static String formatDate(long absTime) { String sdate = sdateformat.format(new Date((long) (absTime * 1E-6))); return sdate; } }