How to use year build-in

How to use year build-in

  

Hey guys i want to use year build in so i can show just the year of the date. How can i use it ?

Thank you

Hi Jeanne,


It's exactly like it says in the example.

Solution

Hi Jeanne,

If you want to show only the year portion of a Date or DateTime field you can also use the FormatDateTime() build in function.

https://success.outsystems.com/Documentation/10/Reference/OutSystems_Language/Logic/Built-in_Functions/Format_Built-in_Functions#FormatDateTime

But using het Year() function also works, Year() is especially usefull if you want to calculate with the year like adding or subtracting from it.

The FormatDateTime will output a string, so this gives you more options on how to represent a year.

The output of both functions you can bind to the value property of an expression.

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

Hi Jeanne,

If you want to show only the year portion of a Date or DateTime field you can also use the FormatDateTime() build in function.

https://success.outsystems.com/Documentation/10/Reference/OutSystems_Language/Logic/Built-in_Functions/Format_Built-in_Functions#FormatDateTime

But using het Year() function also works, Year() is especially usefull if you want to calculate with the year like adding or subtracting from it.

The FormatDateTime will output a string, so this gives you more options on how to represent a year.

The output of both functions you can bind to the value property of an expression.

Regards,

Daniel


Hi daniel,

Thank you for you advice, after i used it I can get the value and purpose that i want. 

Your welcome!