slackhq / slack-api-docs

API Docs for Slack.com
https://api.slack.com/
426 stars 85 forks source link

Slack Attachment ts field time irrelevancy #80

Open houssem-yahiaoui opened 7 years ago

houssem-yahiaoui commented 7 years ago

Hello,

While sending some incoming_webhooks, i'm using attachments as a message template filling it with data, the ts field is filled with a simple Date.now() with simply returns the current Date/Time timestamp and that value is always irrelevant, i'm wondering.

For reproduction : Link : https://api.slack.com/docs/messages/builder Section : attachments. ts value : simply open your nodejs repl and add the Date.now() value.

Is that suppose to happen, what shall i feed that field so i can get the right date.

Thank you.

wlblanchette commented 7 years ago

Have to convert from milliseconds to seconds. Just noticed this too. Date.now() / 1000