Package org.timepedia.chronoscope.client.util

Source Code of org.timepedia.chronoscope.client.util.DateParser

package org.timepedia.chronoscope.client.util;

import com.google.gwt.i18n.client.DateTimeFormat;

import java.util.Date;

/**
* Utility for parsing extended date formats
*/
public class DateParser {
  private static Date date = new Date(0);

  public static double parse(String fmt, String dateString) {
    date.setTime(0);
    if(fmt == null) return Date.parse(dateString);
    DateTimeFormat dtf = DateTimeFormat.getFormat(fmt);
    dtf.parse(dateString, 0, date);
    return date.getTime();
  }
}
TOP

Related Classes of org.timepedia.chronoscope.client.util.DateParser

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.