/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Basic] /src/libs/class/DateTime.ts * @create: 2021-08-05 15:09:01.492 * @modify: 2025-07-08 14:32:04.990 * @version: 6.0.0 * @times: 121 * @lines: 261 * @copyright: Copyright © 2021-2025 Kaven. All Rights Reserved. * @description: [description] * @license: * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************/ import { DateTimeFormat } from "../enum/DateTimeFormat"; import { DayOfWeek } from "../enum/DayOfWeek"; import { TTimeUnit } from "../type/advanced"; export declare class DateTime { private millisecondsSinceEpoch; private date; constructor(millisecondsSinceEpoch?: number); get Year(): number; /** * 1 - 12 */ get Month(): number; /** * 1 - 31 */ get Day(): number; /** * 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. */ get DayOfWeek(): DayOfWeek; /** * ISO */ get WeekOfYear(): number; /** * 0 - 23 */ get Hours(): number; /** * 0 - 59 */ get Minutes(): number; /** * 0 - 59 */ get Seconds(): number; /** * 0 - 999 */ get Milliseconds(): number; private update; private formatNumber; private format; Add(value: number): this; Add(value: number, unit: TTimeUnit): this; Subtract(value: number): this; Subtract(value: number, unit: TTimeUnit): this; Diff(another: DateTime): number; Diff(another: DateTime, unit: TTimeUnit): number; Clone(): DateTime; ToString(): string; ToString(format?: DateTimeFormat | string, timezoneOffset?: number): string; toString(): string; ToLocalString(): string; ToLocalString(format?: DateTimeFormat | string): string; ToDate(): Date; Equals(another: DateTime): boolean; static From(date: Date): DateTime; static From(date: Date, timezoneOffset: number): DateTime; } //# sourceMappingURL=DateTime.d.ts.map