function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LearnerrrLearnerrr 

Get month from object field and get data for that one month using javascript?

MUHAMMED SEMIN P NMUHAMMED SEMIN P N
Hi Sweta,
can you please explain your scenario?
thanks
NagendraNagendra (Salesforce Developers) 
Hi Sweta,

If all you're trying to do is get the month from a Date in Apex this will work:
Object_Name item : [ SELECT RequestDate__c FROM Object_Name limit 1 ];

if (item.RequestDate__c != null)
{
	//Returns a numeric value representing the month (1-12)
	//1 = January
	Integer month = item.RequestDate__c.month();
	
}
Please let us know if this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra