This article introduces you to how Java can determine whether the time is the afternoon or the morning, interested in the code of the Farmer may refer to, see the following code:
Import org.junit.test;/** * Test whether the current time is afternoon or morning * @author Pamgo * */public class Calendart { @Test public void Testtoda Ypmoram () { int i = calendar.getinstance (locale.us). get (CALENDAR.AM_PM); System.out.println (i = = calendar.pm?) "PM": "AM"); } @Test public void TestTodayPMorAM2 () { Boolean IsPM = Calendar.getinstance (). Get (Calendar.hour_of_day) >= ; System.out.println (IsPM? "YES": "NO"); }
Original address: http://www.manongjc.com/article/536.html
Other articles:
D3.js picture vector Diagram + The realization idea of dragging and dragging
ZXing Two-dimensional code parsing generation tool class
Java gluttonous snake Source code sharing
Java randomly generated Chinese name, mobile number, zip code, address
Java to PNG picture fillet processing keep PNG transparent background
Java Verification Code generation source code
Java implementation Configuration loading mechanism
Java GC Expert Series 3:GC tuning practices
Java GC Expert series 2:java monitoring of garbage collection
Whether the Java judge is afternoon or morning