添加测试文件

This commit is contained in:
lixiangrong 2016-08-11 11:52:47 +08:00
parent 3a1b64be9f
commit f58c85833c
2 changed files with 36 additions and 7 deletions

View File

@ -15,7 +15,6 @@
<servlet.version>2.5</servlet.version> <servlet.version>2.5</servlet.version>
<mybatis.version>3.2.7</mybatis.version> <mybatis.version>3.2.7</mybatis.version>
<mybatis.spring.version>1.1.1</mybatis.spring.version> <mybatis.spring.version>1.1.1</mybatis.spring.version>
<mybatis.paging.version>0.0.1</mybatis.paging.version>
<mybatis.generator.core.version>1.3.2</mybatis.generator.core.version> <mybatis.generator.core.version>1.3.2</mybatis.generator.core.version>
<file_encoding>utf-8</file_encoding> <file_encoding>utf-8</file_encoding>
</properties> </properties>
@ -184,12 +183,6 @@
<version>${mybatis.spring.version}</version> <version>${mybatis.spring.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.loafer</groupId>
<artifactId>mybatis-paging</artifactId>
<version>${mybatis.paging.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.mybatis.generator</groupId> <groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId> <artifactId>mybatis-generator-core</artifactId>

View File

@ -0,0 +1,36 @@
package osc.git.eh3.test;
import java.util.Calendar;
import java.util.TimeZone;
/**
* Created by lixiangrong on 2016/8/11.
*/
public class TestCalendar {
public static void main(String[] args) {
long date = 1470844800000l;
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+8"));
TimeZone timeZone = calendar.getTimeZone();
System.out.println(timeZone);
calendar.setTimeInMillis(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
Long startDate = calendar.getTimeInMillis();
System.out.println(startDate);
calendar.setTimeInMillis(date);
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
Long endDate = calendar.getTimeInMillis();
System.out.println(endDate);
}
}