Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Result Of LearnDateUtils.java www.putracode.com
"C:\Program Files\Java\jdk1.8.0_51\bin\java" -Didea.launcher.port=7539 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\bin" -Dfile.encoding=windows-1252 -classpath "C:\Program Files\Java\jdk1.8.0_51\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\zipfs.jar;E:\_GITHUB\PC-COMMONS-LANG3\target\classes;C:\Users\KrisnaPutra\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.putracode.time.Learn_DateUtils
*********************************************
Common-Lang3 : DateUtils
*********************************************
Date Now is : Fri Feb 12 00:00:00 SGT 2016
Add Day 1 : Sat Feb 13 00:00:00 SGT 2016
Add Hours : Fri Feb 12 01:00:00 SGT 2016
Add Miliseconds : Fri Feb 12 00:00:00 SGT 2016
Add Minutes : Fri Feb 12 00:00:00 SGT 2016
Add Seconds : Fri Feb 12 00:00:30 SGT 2016
Add Weeks : Fri Mar 04 00:00:00 SGT 2016
Add Years : Sun Feb 12 00:00:00 SGT 2017
Ceiling : Tue Mar 01 00:00:00 SGT 2016
Get Fragment in a Days : 43
I Same Day true
I Same Instant true
Parse String to Date : Sat Feb 21 00:00:00 SGT 1987
Round Date : 21/02/1987 With CALENDAR.MONTH :Sun Mar 01 00:00:00 SGT 1987
**** if you wan't to change Day, Month and Years. can use setDays,setMonth,setYears
Date = Fri Feb 12 00:00:00 SGT 2016
Date set Days to 1th : Mon Feb 01 00:00:00 SGT 2016
Date set Month to Jan : Fri Feb 12 00:00:00 SGT 2016
Date set Year to 2010 : Fri Feb 12 00:00:00 SGT 2010
trying to set februai to 30th : Exception Set Date in Feb to 30th : DAY_OF_MONTH: 30 -> 1
Truncdate Date : Fri Feb 12 00:00:00 SGT 2016 for Month : Mon Feb 01 00:00:00 SGT 2016
Process finished with exit code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment