DateUtils.java 423 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package com.eksad.masterdata.common;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {

    public static Date stringToDate(String date) throws Exception {
        Date resultDate = null;
        if (date != null) {
            if (!date.isEmpty()) {
                resultDate = new SimpleDateFormat("yyyy-MM-dd").parse(date);
            }
        }

        return resultDate;
    }
}