When querying the records using the date field or the date and time field in the SOQL statement, the date formats should be followed. The following table shows the list of date formats that can be used in the SOQL statements:
Format |
Examples |
---|---|
YYYY-MM-DD |
1999-01-01 |
YYYY-MM-DDThh:mm:ss+hh:mm |
1999-01-01T23:01:01+01:00 |
YYYY-MM-DDThh:mm:ss-hh:mm |
1999-01-01T23:01:01-08:00 |
YYYY-MM-DDThh:mm:ssZ |
1999-01-01T23:01:01Z |