Advanced Spreadsheets – Date and Time Functions
Use date and time functions: today, now, day, month, and year.
To use the different types of functions and formulas in Calc, select the cell in which you want to display the result of the function, and then click on ‘Insert’ from the main menu bar, and from the resulting drop-down menu, click on ‘Function’. This will open the ‘Function Wizard’.
In the ‘Function Wizard’, under the ‘Functions’ tab, we have a ‘Category’ drop-down list. To use the date and time functions, select ‘Date&Time’ in ‘Category’. This will display all the date and time functions under the ‘Function’ drop-down list. From this list, select ‘TODAY’ and click on ‘Next’.
The today function will get displayed in the ‘Formula’ section. After this, click on ‘OK’. The current date of your computer will get displayed in the cell which had been selected initially.
Similarly we can use the other date and time functions. From the same ‘Function Wizard’, under the same ‘Date&Time’ category, we have the ‘NOW’ function. We can use this function in the same way as we did the ‘TODAY’ function and this will display the current date and time of your computer.
In the same wizard, we have the ‘DAY’, ‘MONTH’, and ‘YEAR’ functions. The ‘DAY’ function determines the sequential date of the month as an integer in relation to a date value. The ‘MONTH’ function determines the sequential number of a month of the year for a date value. Similarly the ‘YEAR’ function returns the year of a date value as an integer.
To use any of these functions, in the same ‘FUNCTION WIZARD’, select the appropriate function and then click on ‘Next’. Here, we need to provide a date value.
To provide a date value, use the ‘Select’ icon in front of ‘Number’. When this icon is clicked, the dialog box is minimized and you can select the value of the date from any of the cells from the sheet. Select any cell which stores a complete date value and then again click on this ‘Select’ icon. This will again maximize the dialog and the input will get stored in the function. After this, click on ‘OK’ and the required value will get displayed in the selected cell.
Say we are using the ‘MONTH’ function and the date value which is provided as the input is ‘08/07/15’. In this case the value returned by the ‘MONTH’ function will be ‘7’ which will be an integer value. The ‘YEAR’ and ‘DAY’ functions work in a similar manner.