提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.structure; |
H |
2 |
|
|
3 |
import com.iailab.netsdk.lib.NetSDKLib; |
|
4 |
|
|
5 |
/** |
|
6 |
* @author 47081 |
|
7 |
* @version 1.0 |
|
8 |
* @description \if ENGLISH_LANG |
|
9 |
* <p>\else |
|
10 |
* <p>\endif |
|
11 |
* @date 2020/8/11 |
|
12 |
*/ |
|
13 |
public class NET_TIME_EX extends NetSDKLib.SdkStructure { |
|
14 |
/** 年 */ |
|
15 |
public int dwYear; |
|
16 |
/** 月 */ |
|
17 |
public int dwMonth; |
|
18 |
/** 日 */ |
|
19 |
public int dwDay; |
|
20 |
/** 时 */ |
|
21 |
public int dwHour; |
|
22 |
/** 分 */ |
|
23 |
public int dwMinute; |
|
24 |
/** 秒 */ |
|
25 |
public int dwSecond; |
|
26 |
/** 毫秒 */ |
|
27 |
public int dwMillisecond; |
|
28 |
/** utc时间(获取时0表示无效,非0有效 下发无效) */ |
|
29 |
public int dwUTC; |
|
30 |
/** 保留字段 */ |
|
31 |
public int[] dwReserved = new int[1]; |
|
32 |
|
|
33 |
public void setTime(int year, int month, int day, int hour, int minute, int second) { |
|
34 |
this.dwYear = year; |
|
35 |
this.dwMonth = month; |
|
36 |
this.dwDay = day; |
|
37 |
this.dwHour = hour; |
|
38 |
this.dwMinute = minute; |
|
39 |
this.dwSecond = second; |
|
40 |
this.dwMillisecond = 0; |
|
41 |
} |
|
42 |
|
|
43 |
public String toString() { |
|
44 |
return dwYear + "/" + dwMonth + "/" + dwDay + " " + dwHour + ":" + dwMinute + ":" + dwSecond; |
|
45 |
} |
|
46 |
|
|
47 |
// 用于列表中显示 |
|
48 |
public String toStringTime() { |
|
49 |
return String.format( |
|
50 |
"%02d/%02d/%02d %02d:%02d:%02d", dwYear, dwMonth, dwDay, dwHour, dwMinute, dwSecond); |
|
51 |
} |
|
52 |
|
|
53 |
// 存储文件名使用 |
|
54 |
public String toStringTitle() { |
|
55 |
return String.format( |
|
56 |
"Time_%02d%02d%02d_%02d%02d%02d", dwYear, dwMonth, dwDay, dwHour, dwMinute, dwSecond); |
|
57 |
} |
|
58 |
} |