mirror of
https://github.com/SikongJueluo/cc-utils.git
synced 2025-11-05 11:47:48 +08:00
finish basic access control system
This commit is contained in:
25
src/lib/ccTime.ts
Normal file
25
src/lib/ccTime.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
class ccDate {
|
||||
private _timestamp: number;
|
||||
|
||||
constructor() {
|
||||
this._timestamp = os.time(os.date("*t"));
|
||||
}
|
||||
|
||||
public static toDateTable(timestamp: number): LuaDate {
|
||||
return os.date("*t", timestamp) as LuaDate;
|
||||
}
|
||||
|
||||
public toDateTable(): LuaDate {
|
||||
return os.date("*t", this._timestamp) as LuaDate;
|
||||
}
|
||||
|
||||
public static toTimestamp(date: LuaDate): number {
|
||||
return os.time(date);
|
||||
}
|
||||
|
||||
public toTimestamp(): number {
|
||||
return this._timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
export { ccDate };
|
||||
Reference in New Issue
Block a user