Java Time to String timeString2Date(String time)

Here you can find the source of timeString2Date(String time)

Description

time String Date

License

Open Source License

Declaration

public static Date timeString2Date(String time) throws ParseException 

Method Source Code


//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static final String timeFormat = "hh:mm:ss";

    public static Date timeString2Date(String time) throws ParseException {
        if (time == null) {
            return null;
        }/*from   www .  ja  v  a2  s.  com*/
        return new SimpleDateFormat(timeFormat).parse(time);
    }
}

Related

  1. timesAreEqual(Date date1, Date date2)
  2. timeStr(Date _Date)
  3. timeString()
  4. timeString(double time)
  5. timeString(long tickNo, long offset)
  6. timeToDeparture(String startTime)
  7. timeToFullString(long time)
  8. timeToFullString(long time, boolean longNames)
  9. timeToStr(int time)