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
sumanth v 18sumanth v 18 

Convert date to integer

how to convert date to Integer?
Object__C obj = new Object__c;
if(obj .Start_Date__c - obj .End_Date__c < 7){
            obj.eCPM__c = 7777; //[Number field with decimal 6]
        }
 
Vinod ChoudharyVinod Choudhary
Hi Sumanth,

DateType = Formula
Result = Number 
Formula = 
(DateTime_1__c - DATETIMEVALUE( YOUR_DATE_HERE )) * 86400

Thanks
Vinod
 
sumanth v 18sumanth v 18
Hi vinod,

In apex code i am trying to do. More over the start date and end date date type is DATE.

Thanks
Sumanth 
RKSalesforceRKSalesforce
Please give one example so that i can try providing solution.