Java Millisecond Current Get getMillisec_old(String isoDate)

Here you can find the source of getMillisec_old(String isoDate)

Description

get Milliseold

License

Open Source License

Declaration

private static long getMillisec_old(String isoDate) 

Method Source Code

//package com.java2s;
/*****************************************************************************
 * Source code information/*from  w  w w .ja va2s.  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.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class Main {
    private static SimpleDateFormat formatISODefault = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");

    private static long getMillisec_old(String isoDate) {

        Date date = null;
        formatISODefault.setTimeZone(TimeZone.getTimeZone("GMT"));
        try {
            date = formatISODefault.parse(isoDate);
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return date.getTime();
    }
}

Related

  1. getCurrentMillisecondString()
  2. getCurrentMillisecondZeroFillString()
  3. getCurrentTimeMillisStr()
  4. getMillins(String yyyyMMddHHmmss)
  5. getMillisDurationString(long millis)
  6. getMillisecondStamp(Date date)
  7. getMilliSecondToTomorrow(Date date)
  8. getMillisFromISO8601(Object iso8601)
  9. getMillisFromRFC822String(Object rfc822)