Closed ProductiveRage closed 3 years ago
Hi @ProductiveRage. Currently not looking to move away from identifier being a string - primarily as that's Slack's guidance, and I do try and stick to that guidance when it exists; ignored it on other platforms where the properties seemed numeric and have paid a price for it later on.
If the guidance or documentation changes in the future I'm happy to re-visit
Understood! It feels tantalisingly close to be guaranteed but there just isn't that official definitive reassurance, so I understand your decision entirely. Thanks, though!
I think that the second component in a Slack Timestamp (eg. "1482960137.003543") will always be numeric and so we could parse it as an int or long instead of a string (potentially a nullable one if there are cases where a Timestamp is instantiated with no identifier - I noticed that the "identifier" constructor argument is optional and defaults to a null string).
It would be really helpful to me because I'm trying to import the data into an existing format that uses a DateTime and I want to be able to sort messages correctly that were written within the same second!
The official docs about messages says that:
.. which suggests that the second part will always be numeric.
I've also found a GitHub issue that was commented on by someone who used to work at Slack that says:
.. which also suggests that the second part will always be numeric.
Unfortunately, I can't find any definitive source of information that guarantees it!
What do you think?
(For now, I'm handling this on my end by trying to parse the identifier by prepending a "0." and ensuring that it parses as a double and its value is between 0 and 1 so that I can add that many partial seconds to the time derived from the EpochSeconds value).