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 Answer 1

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
2
  • 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. Dec 3, 2018 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, 2018 at 7:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .