|
|
|
@@ -8,6 +8,7 @@ import java.text.ParseException; |
|
|
|
import java.text.ParsePosition; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalTime; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Date; |
|
|
|
@@ -334,4 +335,15 @@ public class DateUtils extends org.apache.commons.lang.time.DateUtils { |
|
|
|
|
|
|
|
return ldt; |
|
|
|
} |
|
|
|
|
|
|
|
public static String isAmPm(){ |
|
|
|
//判断当前时间是上午还是下午,上午返回am,下午返回pm |
|
|
|
LocalTime currentTime = LocalTime.now(); |
|
|
|
|
|
|
|
if (currentTime.isBefore(LocalTime.NOON)) { |
|
|
|
return "am"; |
|
|
|
} else { |
|
|
|
return "pm"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |