6

What are the minimum and maximum valid dates in Salesforce?

What is the valid date range in Apex, SOQL or SOAP API?

It is hard to find anything in the documentation

3
  • Just curious: why would you need this? – Renato Oliveira Mar 8 '18 at 14:17
  • 3
    To be honest, I met a lot of issues importing data from external systems where building date was older then 1700... So it is useful to know – kurunve Mar 8 '18 at 14:18
  • 3
    I have been working on Salesforce Platform for 5 years and I have never thought about this. However, our client company was acquired by one of the biggest and oldest IT company and now we have to integrate their data into client Salesforce organization and data which comes has some strange date values like '99991231', '00010101', '99999999' 0001,01,01 0059,01,01 etc. – Patlatus Mar 8 '18 at 15:23
9

Initially I have found an answer here, but the link provided in that answer, was broken.

Finally found a corresponding valid link in the documentation

Minimum and Maximum Dates

Only dates within a certain range are valid. The earliest valid date is 1700-01-01T00:00:00Z GMT, or just after midnight on January 1, 1700. The latest valid date is 4000-12-31T00:00:00Z GMT, or just after midnight on December 31, 4000. These values are offset by your time zone. For example, in the Pacific time zone, the earliest valid date is 1699-12-31T16:00:00, or 4:00 PM on December 31, 1699.

2
  • 1
    I just wonder what would happen after this 4000-12-31T00:00:00Z GMT. Hope the humans still use the Salesforce. – Arnold Jr. Mar 8 '18 at 14:44
  • @ArnoldJr. I know I personally can't wait for APIv5987.0 :p – Derek F Mar 8 '18 at 14:46

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.