1

Could someone please help me with a formula to convert Date field's value into milliseconds. I need the millisecods to be calculated from 01st Jan 1970. Thanks in advance. Convert Date

1

You just need to use regular subtraction, then multiply by 86400000.

Date

(Date__c - DATE(1970, 1, 1)) * 86400000

DateTime

(Date_Time__c - DATETIMEVALUE("1970-01-01 00:00:00")) * 86400000
| improve this answer | |
  • Thanks for the info. I tried the first formula with type Date, Date/Time and Time, but it gave syntax error- 'Formula result is data type (Date), incompatible with expected data type (Time). (Related field: Formula)'. It was successful with type Number. Hope that's fine. – Salesforce Learner Dec 3 '18 at 7:30
  • @SalesforceLearner Yes, "time" values are a hour:minute:second type deal, not suited for millisecond display. Number is the type I would have expected you to use. – sfdcfox Dec 3 '18 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.