I have a webhook that posts a message to a Slack channel. Is there a way to ensure that times mentioned in the message are shown in the user's local timezone?
Slack's API allows you to output time in the user's timezone using a special placeholder. See Formatting Dates in the API documentation.
As per the slack API documentation, the chat.postMessage
method returns a JSON with a response like this one here
{
"ok": true,
"ts": "1405895017.000506",
"channel": "C024BE91L",
"message": {
...
}
}
So, i guess you can parse and get the timestamp and format it according to your need . Here is the link to slack api postMessage API documentation. Just to mention, ts
is timestamp in above JSON response.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With