Handling Dates and Times in PostgreSQL Like a Hero

preview_player
Показать описание
As programmers we need to work with dates and times, but we typically rely on languages and frameworks to handle all of this for us. This approach can work, until it comes to reporting and you're asked how you handled time zones, daylight savings, and location offsets!

The free Little SQL Book:

My Blog, with lots of Postgres videos:
Рекомендации по теме
Комментарии
Автор

This is awesome. My first time seeing generated columns

tonyeneh
Автор

This channel absolutely deserves more subs. Hope you reach there one day. (don't forget me when you become famous lol).

Agent
Автор

do you have a discord server ? or a community for similar interests people

oubayryuuk
Автор

This is incorrect. You changed the time being stored. If you have UTC in the database you need to always deal with it as UTC. If you were inserting records and specifying a time using the current time zone your code was wrong. Your SQL here changes the time that is stored in the row, so of course you get different results. If I store an int of 10 in one row and 10 minus 4 in another, those are different values. Look at your insert ststements, you are specifying an explicit time as a string without specifying the time zone! Your inserts are the problem / bad code. It has nothing to do with how the column is configured.

Me__Myself__and__I
Автор

How to display the created_at column data in two seperate columns as date and time plz give reply for this comment plz 🙏

shaikimran