Get fiscal year from posting date

Hello,

I want to set fiscal year automatically based on posting date.
For ex. if I have entered 01/06/2017 as posting date then fiscal year field should auto populate by 2017-2018.

is there any default functionality created by ERPNext?