library-ts/browser/date/ISOTimeStamp.ts

24 lines
418 B
TypeScript
Raw Normal View History

2025-11-10 17:41:48 +00:00
import { DateHelper } from "./DateHelper";
export class ISOTimeStamp
{
value:string;
static toDate( stamp:ISOTimeStamp ):Date
{
return new Date( stamp.value );
}
static fromDate( date:Date ):ISOTimeStamp
{
let stamp = new ISOTimeStamp();
stamp.value = date.toISOString();
return stamp;
}
static now():ISOTimeStamp
{
return ISOTimeStamp.fromDate( DateHelper.now() );
}
}