Free Salesforce Developers Tutorials >

Chapter 3 - Apex Datatypes and Operators >

Date Datatypes in APEX

Date Datatypes in APEX

What You’ll Learn


What is Date datatype in Salesforce?What is Date datatype in Salesforce?

Syntax of using Date datatype in ApexSyntax of using Date datatype in Apex

Example and Method of Date DatatypeExample and Method of Date Datatype (Learn From Video)

S2 Labs

What Is Date Datatype In Salesforce?

A value that indicates a particular date. Date values contain no information about time. 

Data Datatype Syntax

Date d = Date.newInstance(2016,6,15);

Example And Method Of Date Datatype

// newInstance Method
Date myDate = Date.newInstance(1960, 2, 17);

// addDays Method
Date newDate2 = myDate.addDays(2); 

// addMonths Method
Date newDate3 = myDate.addMonths(3);

// addYears Method
Date newDate4 = myDate.addYears(2);
salesforce cloud

Download Study Material

Get access to exclusive study material for Salesforce Certification and ace your exams!

Download Now

Our Salesforce Certification Courses

Hey there! Glad you made it through our Salesforce Developer Training for beginners . But wait! We've got some high-in-demand Salesforce courses for you to take your Salesforce skills to the next level, making you a desired professional in the Salesforce job market.

Post a Comment

Your email address will not be published. Required fields are marked *