Skip to content

Prefer string over date/time? #380

Answered by jongpie
rmccu asked this question in Q&A
Discussion options

You must be logged in to vote

This is by design, the string-based value is more accurate than the actual Timestamp__c datetime field - I have a comment elsewhere in the codebase that provides a bit more context, but essentially, the issue is that Salesforce does not provide accurate timestamps for platform events within an Apex trigger (see screenshot below), so I use the string version of the timestamp because it will include accurate milliseconds when it's converted back into a datetime value.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rmccu
Comment options

Answer selected by jongpie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants