Answer the question
In order to leave comments, you need to log in
How to get week number from american style date?
There is such a request: select EXTRACT(WEEK from '2016-01-01'::TIMESTAMP)
which returns 53. I.e. works according to the iso standard.
Is it possible to somehow work on am. style? Those. to
select EXTRACT(WEEK from '2016-01-01'::TIMESTAMP) => 1
select EXTRACT(WEEK from '2016-01-03'::TIMESTAMP) => 2
Answer the question
In order to leave comments, you need to log in
"American style" is when the date is in the middle? Then like this:
SELECT EXTRACT(WEEK from to_timestamp('2016-25-08', 'YYYY-DD-MM'));
www.w3schools.com/sql/func_date_format.asp
Here is a nice function, have a look
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question