Tips for handling timezones in Postgres

  Рет қаралды 7,909

Aaron Francis

Aaron Francis

Күн бұрын

Пікірлер: 48
@mehdi_sadeghi
@mehdi_sadeghi 4 ай бұрын
Dude, when you were teaching MySQL back then, I really wished you’d do Postgres. Now that it’s happening, I’m really happy!
@aarondfrancis
@aarondfrancis 4 ай бұрын
❤️ the universe conspired
@glitchinLife
@glitchinLife 11 күн бұрын
You have no idea how frustrating that inverted sign of the tz was the first time I found it, funny enough the same issue can be found when using the TZ in POSIX shell. You explained it perfectly, hopefully no one else will struggle with it ❤
@MrZax-kl5si
@MrZax-kl5si 4 ай бұрын
These videos are the best. Keep pumping this content Aaron
@awksedgreep
@awksedgreep Ай бұрын
Great video! DBA of over 1400 databases and the most successful groups I support stopped the video at 2:26. ;)
@Voltra_
@Voltra_ 4 ай бұрын
My personal go-to is to store dates as UTC timestamps in the database, and parse the UTC timestamp on the client side (sometimes directly, or with Date.UTC). Oh, and to never manipulate timezones (or worse, offsets)
@additionaddict5524
@additionaddict5524 4 ай бұрын
aaron is the godfather
@CodingWithTaaxo
@CodingWithTaaxo 4 ай бұрын
Hey Aaron, If you're still putting together that course, I'd be down if you could throw in a section on cron jobs. I'm learning Postgres, and your teaching style is the bomb. Can't wait to grab your course!
@aarondfrancis
@aarondfrancis 4 ай бұрын
Oh nice, added to my list!
@dalcod
@dalcod 4 ай бұрын
That is a good suggestion.
@FrankGehann
@FrankGehann 4 ай бұрын
This was a really great sum up. Thank you very much!
@coffeeowl86
@coffeeowl86 4 ай бұрын
Amazing content as always! I'm glad you're also covering Postgres. Best wishes 🤗 Update: I joined the wait list for the course :D
@dnukeranged
@dnukeranged 4 ай бұрын
full course hype
@aarondfrancis
@aarondfrancis 4 ай бұрын
😮‍💨 it's coming so soon! I gotta hurry!
@gilesbbb
@gilesbbb 4 ай бұрын
This is set up for covering special relativity in the next video, yes?
@fabriai
@fabriai 3 ай бұрын
@Aaron, do you touch on PG Trunk in the course?
@nolocobralink
@nolocobralink 4 ай бұрын
is there a way to show the offset on the final date without having to change the time zone on the session? for example, I'm in the America/Santiago timezone (currently on daylight saving time), and a former colleague made a small application using Postgres as the db and set UTC as the overall time zone (not just in the db), if I use the REST API of the app to check the records, all the dates will be on UTC with the offset "+00", if I ever added a query parameter that allowed me to show all the dates on a specific time zone (in this case America/Santiago), how can I implement that without changing the time zone on the session and still get the offset? ("-04" or "-03" depending on daylight saving)
@jrheaberlin
@jrheaberlin 4 ай бұрын
What client are you using?
@aarondfrancis
@aarondfrancis 4 ай бұрын
TablePlus!
@hectoreduardosolanopestana6964
@hectoreduardosolanopestana6964 4 ай бұрын
Hello Aaron, I heard in one of your videos that you were an accountant by profession. I would like to know how you transitioned to becoming a PHP developer and working with Laravel, or if you have a video where you share this story. Best regards, and thank you for your content!
@HashimWarren
@HashimWarren 4 ай бұрын
Is the course project based? Looking forward to it
@djasnive
@djasnive 4 ай бұрын
Since when did you use Postgres
@aarondfrancis
@aarondfrancis 4 ай бұрын
I'm a free agent now!
@jricardoprog
@jricardoprog 4 ай бұрын
Comparing timestamp is also annoying in pg, I need to remove 1ms to find the same record
@HolgerJakobs
@HolgerJakobs 3 ай бұрын
Can you provide an example?
@quintenkamphuis
@quintenkamphuis 4 ай бұрын
8:30 base because Docker haha
@aarondfrancis
@aarondfrancis 4 ай бұрын
haha I dont know what I was thinking
@sahaj.r
@sahaj.r 4 ай бұрын
Time stone 😄
@djordje1999
@djordje1999 4 ай бұрын
Why not just store unix timestamp?
@HolgerJakobs
@HolgerJakobs 3 ай бұрын
1. Who can read and write them? 2. Unix timestamps are by defintion UTC. Let PostgreSQL do the work for you. Having each session set to the timestamp the person is residing in, everybody will be fine naively handling all timestamps.
@estebanmurcia8451
@estebanmurcia8451 4 ай бұрын
6:42 guilty as charged
@aarondfrancis
@aarondfrancis 4 ай бұрын
gottem
@saryakan
@saryakan 4 ай бұрын
Best tip on handling time zones? Don't.
@HolgerJakobs
@HolgerJakobs 3 ай бұрын
Exactly. Let PostgreSQL do this for you. The PostgreSQL Global Developer Group are more of experts than you (and I) are.
@luca4479
@luca4479 4 ай бұрын
What kind of camera do you use to film your videos? Your camera quality is on par with MKBHD and LTT, I’m in awe!
@aarondfrancis
@aarondfrancis 4 ай бұрын
Canon R6!
@codedusting
@codedusting 4 ай бұрын
Timezones of all things should have been a physics problem, not politics. How did that even happen?
@aarondfrancis
@aarondfrancis 4 ай бұрын
Geeze, I dunno. It sucks though
@codedusting
@codedusting 4 ай бұрын
@@aarondfrancis yes. I had to make a real estate auction site for Dubai UAE but international buyers. It was quite hell back in 2020.
@melvillespence6768
@melvillespence6768 4 ай бұрын
Where do you set the origin? Greenwich was chosen in 1884 at the Meridian Conference, when the UK was the preeminent power. GMT was adopted within the UK in 1847 because of the railways. BST came in WW1 to make best use of the working day, in WW2 we had double summer time for the same reason. In an ideal world we would use 15 degrees of longitude = 1 hour, but 🤣
@HolgerJakobs
@HolgerJakobs 3 ай бұрын
Who has the power to determine? And clearly, it's a good idea to have a single time zone in at least most countries. Only a few countries stretch so far east-west that several time zones are necessary. Having physics strictly determining the time zone would mean that most countries (except the very small ones) have several time zones, which would not come in handy. We have the same time zone in a lot of countries: Norway, Sweden, Denmark, Poland, Czech Republic, Slovakia, Slovenia, Germany, Austria, Italy, Switzerland, France, Luxemburg, Netherlands, Belgium, Andorra, Spain.
@dalcod
@dalcod 4 ай бұрын
October 15 is too far for me lol.
@prashlovessamosa
@prashlovessamosa 3 ай бұрын
Your background is too good.
@jrdnrc
@jrdnrc 4 ай бұрын
thanks i hate timezones
@HolgerJakobs
@HolgerJakobs 3 ай бұрын
No need do. Let PostgreSQL handle everything for you and you'll be fine. Just make sure that every session has the time zone set to the place where the person resides running it.
@kirayamato6128
@kirayamato6128 4 ай бұрын
Aaron ❤️🧡💛💚🩵💙💜🤎🖤🩶🤍🩷
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 107 М.
Free, fast, full text search: Laravel + Typesense
22:04
Aaron Francis
Рет қаралды 14 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Migrating from Postgres to SQLite with Kent C. Dodds
57:02
Aaron Francis
Рет қаралды 16 М.
Just store UTC? Handling Time Zones & Daylight Saving
7:44
CodeOpinion
Рет қаралды 35 М.
The Problem with Time & Timezones - Computerphile
10:13
Computerphile
Рет қаралды 4,1 МЛН
Dictionaries | Python Programming
28:52
LVEcon
Рет қаралды 10
Postgres just got even faster
26:42
Hussein Nasser
Рет қаралды 38 М.
Vectors in SQLite! (with libSQL)
16:31
Aaron Francis
Рет қаралды 9 М.
SQLite's WAL mode is fast fast
9:25
Aaron Francis
Рет қаралды 30 М.
You don't need NoSQL (use MySQL)
31:26
PlanetScale
Рет қаралды 76 М.
Laravel Dusk: painless browser automation
20:49
Aaron Francis
Рет қаралды 25 М.
SQLc is the perfect tool for those who don't like ORMs
28:11
Dreams of Code
Рет қаралды 118 М.