What's the best way to have a field for a date in PostgreSQL and TypeORM?
I'm relatively new in PostgreSQL (in general SQL database), but in MongoDB (with Mongoose) I usually have a field like this:
export class User {
@Prop({ default: Date.now() })
createdAt: Date;
}
What would be the equivalent to this in TypeORM and PostgreSQL? Because, if I use this approach, PostgreSQL throws me an error.
QueryFailedError: date/time field value out of range: "1634416004545"