MySQL datetime column saved correctly, but converted to UTC again on retrieval

Viewed 3147

I'm using typeorm version 0.2.18 and I have a model with a CreateDateColumn and when I save the model it saves a correct UTC time (I'm in EST). However, when I retrieve the record from the database the date is again converted into UTC. I also opened a github issue on this: https://github.com/typeorm/typeorm/issues/4261

I attempted to change the column to a "datetime" column and it always seems to convert the retrieved date to UTC again even though in the database it is UTC.

[...]
@Entity()
export class Book{
    @PrimaryGeneratedColumn()
    BookId: number;

    @Column()
    BookName: string;

    @Column()
    Genre: string;

    @CreateDateColumn()
    DateAdded: Date;
}

I don't get any errors, but the retrieved date is always converted to UTC again.

1 Answers
Related