I have a date and I want to get just the year from it as an integer.
Use extract
SELECT extract( year FROM CURRENT_DATE )::int;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With