• Tomas Mizerak
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi Salesforce developers,

I am exporting standard Contact fields with Salesforce SOQL. I need to import it to other tool but I need to convert LastModifiedDate, which is ISO datetime string, into Unix timestamp seconds from 1/1/1970.
 
SELECT Email,LastModifiedDate FROM Contact

	Email							LastModifiedDate
1	john.doe@trailhead.com			2020-10-27T14:06:12.000Z
2	laetitia.arevik@trailhead.com	2020-10-27T14:06:11.000Z

Do you have any ideas how to do that?

I am using iPaaS platform to load SOQL via API (app.tray.io, elastic.io and [Salesforce Workbench][1] for debugging issues) so I don't have access to write custom javascript or apex code.

I checked the official [Salesforce Date functions][2], but I don't see a function that I need.

**Not** working:
 
SELECT Email,FirstName,LastModifiedDate.getTime(),LastName FROM Contact
SELECT Email,FirstName,DateTime(LastModifiedDate).getTime(),LastName FROM Contact

Thank you for your ideas!

  [1]: https://workbench.developerforce.com/
  [2]: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_date_functions.htm
Hi Salesforce developers,

I am exporting standard Contact fields with Salesforce SOQL. I need to import it to other tool but I need to convert LastModifiedDate, which is ISO datetime string, into Unix timestamp seconds from 1/1/1970.
 
SELECT Email,LastModifiedDate FROM Contact

	Email							LastModifiedDate
1	john.doe@trailhead.com			2020-10-27T14:06:12.000Z
2	laetitia.arevik@trailhead.com	2020-10-27T14:06:11.000Z

Do you have any ideas how to do that?

I am using iPaaS platform to load SOQL via API (app.tray.io, elastic.io and [Salesforce Workbench][1] for debugging issues) so I don't have access to write custom javascript or apex code.

I checked the official [Salesforce Date functions][2], but I don't see a function that I need.

**Not** working:
 
SELECT Email,FirstName,LastModifiedDate.getTime(),LastName FROM Contact
SELECT Email,FirstName,DateTime(LastModifiedDate).getTime(),LastName FROM Contact

Thank you for your ideas!

  [1]: https://workbench.developerforce.com/
  [2]: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_date_functions.htm