ts-typed-sql icon indicating copy to clipboard operation
ts-typed-sql copied to clipboard

Timestamptz type

Open phiresky opened this issue 8 years ago • 0 comments

class TimestampTZType extends s.Type<Date, Date, "date"> {
    name = 'timestamptz';
    serialize(arg: Date): string | number | boolean {
        return arg as any;
    }

    deserialize(arg: string | number | boolean): Date {
        return new Date("" + arg);
    }
}
export const timestamptz = new TimestampTZType;

phiresky avatar Jun 04 '17 20:06 phiresky