How can I build a formula to extract the year of a date field? I'm trying to do this with the field
DateofBirth of datatype
For example if
DateofBirth=1980-12-19 00:00:00, I want the formula to evaluate to the
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
If you have a
Date field, you can simply use the
YEAR() formula function
The reason why you want to use this over manually splitting up a date string (besides it being shorter) is because the display format of a date/datetime field depends on the locale of the user.
There are lots of locales, and not all of them have the year in the same place (first good examples I found were Azerbaijan and Belarus).