Java Parse Date Pattern YYYY parseDatabaseDate(String dateString)

Here you can find the source of parseDatabaseDate(String dateString)

Description

parse Database Date

License

Open Source License

Declaration

public static String parseDatabaseDate(String dateString) throws ParseException 

Method Source Code

//package com.java2s;

import java.text.DateFormat;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String parseDatabaseDate(String dateString) throws ParseException {
        String oldScheduledDate = dateString.replaceAll("/", "-");
        DateFormat oldFormatter = new SimpleDateFormat("dd-MM-yyyy");
        DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        Date oldDate = (Date) oldFormatter.parse(oldScheduledDate);
        return formatter.format(oldDate);
    }// w ww.  jav  a  2  s  . c  om
}

Related

  1. parseCalendar2String(Calendar calendar)
  2. parseCalendarString(String dateTimeString)
  3. parseCDADateFormat(String xsdDate)
  4. parseCompactDate(String exp)
  5. parseCoTDate(String dateString)
  6. parseDD(String dateStr)
  7. parseDelayTime(String time)
  8. parseDIGTime(String timestr)
  9. parseDisplay4Key(Object date)