47 lines
1.0 KiB
TypeScript
47 lines
1.0 KiB
TypeScript
/**
|
|||
|
|
* 网络时间数据
|
||
|
|
*/
|
||
|
|
import { BaseData } from "./BaseData";
|
||
|
|
|
||
|
|
export class NetTimeData extends BaseData {
|
||
|
|
// 服务端时间戳
|
||
|
|
private _serverTime = "";
|
||
|
|
// 服务器时区
|
||
|
|
private _timezoneOffset = 0;
|
||
|
|
|
||
|
|
/** 设置服务端时间戳 */
|
||
|
|
public set serverTime(value: string) {
|
||
|
|
this._serverTime = value;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 获取服务端时间戳 */
|
||
|
|
public get serverTime(): string {
|
||
|
|
return this._serverTime;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 设置服务器时区 */
|
||
|
|
public set timezoneOffset(value: number) {
|
||
|
|
this._timezoneOffset = value;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 获取服务器时区 */
|
||
|
|
public get timezoneOffset(): number {
|
||
|
|
return this._timezoneOffset;
|
||
|
|
}
|
||
|
|
|
||
|
|
public reset(): void {
|
||
|
|
this._serverTime = "";
|
||
|
|
this._timezoneOffset = 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
public clear(): void {
|
||
|
|
this._serverTime = "";
|
||
|
|
this._timezoneOffset = 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
public destroy(): void {
|
||
|
|
super.destroy();
|
||
|
|
this._serverTime = null;
|
||
|
|
this._timezoneOffset = null;
|
||
|
|
}
|
||
|
|
}
|