|
|
|
@ -5,13 +5,15 @@ import com.glxp.api.BaseApiAdminApplicationTest;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
|
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
public class NormalTest extends BaseApiAdminApplicationTest {
|
|
|
|
|
public class NormalTest extends BaseApiAdminApplicationTest {
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(NormalTest.class);
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@ -30,7 +32,6 @@ public class NormalTest extends BaseApiAdminApplicationTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static long getStartTime(String startTime) {
|
|
|
|
|
final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
|
|
|
|
final Date datetime;//将你的日期转换为时间戳
|
|
|
|
@ -48,12 +49,28 @@ public class NormalTest extends BaseApiAdminApplicationTest {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testTime(){
|
|
|
|
|
log.info(getStartTime("17:30:01")+"");
|
|
|
|
|
}
|
|
|
|
|
@AutoConfigureWebTestClient
|
|
|
|
|
public void testTime() {
|
|
|
|
|
// log.info(getStartTime("17:30:01")+"");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String data = "2022-07-15";
|
|
|
|
|
String setTime = "2022-09-26";
|
|
|
|
|
|
|
|
|
|
if (data.length() > 10) {
|
|
|
|
|
String resultDate = data.substring(0, 10);
|
|
|
|
|
log.info("1=" + resultDate);
|
|
|
|
|
if (setTime.compareTo(resultDate) > 0) {
|
|
|
|
|
log.info(">1" + resultDate);
|
|
|
|
|
}
|
|
|
|
|
} else if (data.length() == 10) {
|
|
|
|
|
if (setTime.compareTo(data) > 0) {
|
|
|
|
|
log.info(">2" + data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|