Activity Forums Salesforce® Discussions What are the different methods in date class in Salesforce?

  • Kirandeep

    Member
    February 20, 2020 at 11:46 am

    Hi Aditya,

    List of Methods in date Class :-

    • addDays(additionalDays)
    • addMonths(additionalMonths)
    • addYears(additionalYears)
    • day()
    • dayOfYear()
    • daysBetween(secondDate)
    • daysInMonth(year, month)
    • isLeapYear(year)
    • format()
  • Shweta

    Member
    February 20, 2020 at 2:00 pm

    Date Methods in Salesforce:

    • addDays: Adds the specified number of additional days to a Date.
    • addMonths: Adds the specified number of additional months to a Date
    • addYears: Adds the specified number of additional years to a Date
    • day(): Returns the day-of-month component of a Date.
    • dayOfYear(): Returns the day-of-year component of a Date.
    • daysBetween(secondDate): Returns the number of days between the Date that called the method and the specified date.
    • daysInMonth(year, month)
    • format()
    • month()
    • newInstance(year, month, day)
    • today()
    • year()

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos