Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.joda.time.LocalDate;

public class Main {
    public static LocalDate dateStringToDate(String datetime) {
        String[] dateTimeTemp = datetime.split(" ");
        String[] parcels = dateTimeTemp[0].split("-");
        if (parcels.length == 3) {
            return new LocalDate(Integer.parseInt(parcels[0]), Integer.parseInt(parcels[1]),
                    Integer.parseInt(parcels[2]));
        }
        return null;
    }
}