Here you can find the source of convertDateToURLFormat(final String dateToBeConvert)
public static String convertDateToURLFormat(final String dateToBeConvert)
//package com.java2s; /**// ww w.j a va 2 s. c o m * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { public static String convertDateToURLFormat(final String dateToBeConvert) { final SimpleDateFormat oldFormat = new SimpleDateFormat("dd MMMMMM yyyy", Locale.US); final SimpleDateFormat newFormat = new SimpleDateFormat("yyyy-MM-dd"); String reformattedStr = ""; try { reformattedStr = newFormat.format(oldFormat.parse(dateToBeConvert)); } catch (final ParseException e) { e.printStackTrace(); } return reformattedStr; } }