Java Day getDay(String string)

Here you can find the source of getDay(String string)

Description

Returns the day given a string in format dd-MMM-yyyy.

License

Apache License

Declaration

public static Date getDay(String string) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

import java.util.Date;

public class Main {
    /** Returns the day given a string in format dd-MMM-yyyy.
     *///w w w. j a v  a 2 s. c o m
    public static Date getDay(String string) {
        if (string == null) {
            return null;
        }
        Date date = null;
        try {
            date = (new SimpleDateFormat("dd-MMM-yyyy").parse(string));
        } catch (ParseException ex) {
            return null;
        }
        return date;
    }
}

Related

  1. getDay(java.util.Date date)
  2. getDay(SimpleDateFormat df, String dateStr)
  3. getDay(String aDate)
  4. GetDay(String agmipDate)
  5. getDAY(String strDate)
  6. getDay(String tempdat, Locale locale)
  7. getDayAfter(String dateformat, String day, int filed, int delta)
  8. getDayAfterTommorrowsDateFne()
  9. getDayBefore(Date date)