Here you can find the source of parseDate(final String revision)
public static Date parseDate(final String revision)
//package com.java2s; /*//w w w . j a va 2 s . c om * Copyright (c) 2014 Cisco Systems, Inc. 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 */ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(final String revision) { final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); try { return formatter.parse(revision); } catch (final ParseException e) { throw new IllegalArgumentException("Date not valid", e); } } }