richie
6 years ago
1 changed files with 0 additions and 30 deletions
@ -1,30 +0,0 @@
|
||||
package com.fr.demo; |
||||
|
||||
import com.fr.third.joda.time.DateTime; |
||||
import com.fr.third.joda.time.LocalDate; |
||||
import com.fr.third.joda.time.format.DateTimeFormat; |
||||
import com.fr.third.joda.time.format.DateTimeFormatter; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-02-12 |
||||
*/ |
||||
public class Test { |
||||
|
||||
public static void main(String... args) { |
||||
LocalDate date = LocalDate.now(); |
||||
|
||||
System.out.println(date); |
||||
|
||||
String dateTime = "11/15/2013 08:00:00"; |
||||
// Format for input
|
||||
DateTimeFormatter dtf = DateTimeFormat.forPattern("MM/dd/yyyy HH:mm:ss"); |
||||
// Parsing the date
|
||||
DateTime jodatime = dtf.parseDateTime(dateTime); |
||||
// Format for output
|
||||
DateTimeFormatter dtfOut = DateTimeFormat.forPattern("MM/dd/yyyy"); |
||||
// Printing the date
|
||||
System.out.println(dtfOut.print(jodatime)); |
||||
} |
||||
} |
Loading…
Reference in new issue