Timestamp mode differences?

Mmr_pablo5/26/2023
What is the difference between the timestamp "mode" of "string'"and "date"?
KKairu5/26/2023
looks like date outputs as a js Date object, string outputs it as a string
was actually gonna make a post asking for the ability to cast properties for just this reason, since Date objects cant be serialized between the nextjs server->client boundary
KKairu5/26/2023
seems like i can get rid of superjson now
ASAndrii Sherman5/26/2023
Yeah, it was done in a way to get a full control on date string parsing
ASAndrii Sherman5/26/2023
you can enable mode: string and get raw string from database
ASAndrii Sherman5/26/2023
and then parse to date using specific timezones, etc.
ASAndrii Sherman5/26/2023
and not rely on a way drizzle does string to date mapping
Mmr_pablo5/26/2023
Ah, so its just for how the data is marshalled from the database? Gotya. I thought it had something to do with the creation of the column in MySQL
ASAndrii Sherman5/26/2023
yeah
Mmr_pablo5/26/2023
Excellent, thank you
Mmr_pablo5/26/2023
side question (as ive not done mysql for years!) whats the preferred column type for a UNIX timestamp?
Mmr_pablo5/26/2023
(the timestamp type in mysql is for ISO style datetimes afaik, eg 2023-05-26 12:30:00)
Mmr_pablo5/26/2023
hmm, looks like an unsigned int is the safest approach
Mmr_pablo5/26/2023
😎