Date Time Functions

Module: M1-R5: Information Technology Tools and Network Basics

Chapter: Spreadsheet

Introduction

Date and Time functions in LibreOffice Calc are used to work with dates, times, and perform calculations such as finding days between dates, extracting parts of a date, or adding months to a date.

1️⃣ TODAY()

Purpose: Returns the current system date.

Formula: =TODAY()

Result: If today’s date is 03-Nov-2025 → 03/11/2025

2️⃣ NOW()

Purpose: Returns the current date and time.

Formula: =NOW()

Result: 03/11/2025 16:45

3️⃣ DAY()

Purpose: Extracts the day from a date.

Formula: =DAY("2025-11-03")

Result: 3

4️⃣ MONTH()

Purpose: Extracts the month number from a date.

Formula: =MONTH("2025-11-03")

Result: 11

5️⃣ YEAR()

Purpose: Extracts the year number from a date.

Formula: =YEAR("2025-11-03")

Result: 2025

6️⃣ WEEKDAY()

Purpose: Returns a number representing the day of the week (1=Sunday, 7=Saturday).

Formula: =WEEKDAY("2025-11-03")

Result: 2 (Monday)

7️⃣ DATEDIF()

Purpose: Calculates the difference between two dates in days, months, or years.

Formula: =DATEDIF("2020-01-01";"2025-01-01";"y")

Result: 5 years

8️⃣ EDATE()

Purpose: Returns the date that is a specified number of months before or after a given date.

Formula: =EDATE("2025-01-15";6)

Result: 15-Jul-2025

9️⃣ EOMONTH()

Purpose: Returns the last day of the month after adding a certain number of months to a date.

Formula: =EOMONTH("2025-02-10";1)

Result: 31-Mar-2025

🔟 HOUR(), MINUTE(), SECOND()

Purpose: Extracts hour, minute, and second from a time value.

Formula Examples:

  • =HOUR("14:45:30") → 14
  • =MINUTE("14:45:30") → 45
  • =SECOND("14:45:30") → 30
📊 Example Table – Date & Time Functions
Function Description Example Result
TODAY()Returns current date=TODAY()03/11/2025
NOW()Returns current date & time=NOW()03/11/2025 16:45
DAY()Extracts day from date=DAY("2025-11-03")3
MONTH()Extracts month=MONTH("2025-11-03")11
YEAR()Extracts year=YEAR("2025-11-03")2025
WEEKDAY()Day of the week=WEEKDAY("2025-11-03")2
DATEDIF()Difference in years=DATEDIF("2020-01-01";"2025-01-01";"y")5
EDATE()Adds months to a date=EDATE("2025-01-15";6)15-Jul-2025
EOMONTH()Last day of month after N months=EOMONTH("2025-02-10";1)31-Mar-2025
HOUR()Extracts hour=HOUR("14:45:30")14
MINUTE()Extracts minute=MINUTE("14:45:30")45
SECOND()Extracts second=SECOND("14:45:30")30
📘 Practical Example

Below is sample employee data to demonstrate date calculations:

Employee Join Date Current Date Years of Service (DATEDIF) Next Review (EDATE +12)
Rahul01/04/2020=TODAY()=DATEDIF(B2;C2;"y") → 5=EDATE(B2;12) → 01/04/2021
Priya15/08/2022=TODAY()=DATEDIF(B3;C3;"y") → 3=EDATE(B3;12) → 15/08/2023
Conclusion

Date and Time functions are vital for time tracking, project planning, and payroll systems. They simplify complex calculations like tenure, deadlines, or scheduling automatically based on system date.

Quick Links