If timming is being collected at different devices they will always be different from device to device as they are not synchronized with each other. I see only to options to solve it:
-If messages are being sent immediatly, you can set the message time as the time of message arriving, as they will "probably" arrive by the order they have been sent. The "probably" is because some user may have a slower internet connection which may delay the message, but it shouldn't be significative for most uses.
-If messages are being sent later in time, you would have to connect to a time server, get the time from there to set in the message. Of corse, you wouldn't need to connect for every message, just on start of the application and get the time difference between the device and the server, and then apply that difference for every message.
-If your application requires GPS to be enabled, you can also get the exact time from it. As GPS uses UTC, you would need to apply the correction for your timezone.
--EDITED--
Some more detail on how to get the time difference from a time server:
1-On application start you connect to a time server to get the exact time and compare that time with the device time. You store the time difference in a variable to use later.
2-Every time you want to send a message using Cloud API, you get the device time, add the time difference obtained in step 1 above and set the message time to this value. You may also need to apply corrections related to different time zones, if you have users in different contries.
good luck.