Postgresql: get month from date

Trabla: Postgresql: get month from date

Solving:

1. From Date

select date_part( 'month' , date '2015-02-16') 

Result: 2

2. From Timestamp

select date_part( 'month' , timestamp '2015-02-16 20:38:40')

Result: 2

No comments:

Post a Comment