Outgoing SMS with Amazon SNS
I am having this same error again. I believe it's something to do with the fact the clocks have recently gone forward in London.
When I run "date"at the SSH command prompt I can see the correct time based on the timezone "Europe/London". However when I run "wget -S "https://mydomain.com""the time is one hour behind. I don't understand why there is a difference.
Can you please tell me how to update the time that is returned by running wget -S "https://mydomain.com"? I think I need this to be forward an hour and then the issue should be resolved.
The HTTP header will only give you the time in UTC/GMT. This part of the HTTP specification, in RFC7231 section 184.108.40.206 and 220.127.116.11.
So maybe this can't be updated... in which case I am still not sure what to do to fix this!
Any help would be hugely appreciated.
ps. mydomain.com is a placeholder, I am using my real domain when running the command!
OK, I have managed to get the SMS messages to send by updating the outgoingSMS plugin code as follows:
$timeStamp = date("Y-m-d\TH:i:s");
$bstTime = date('Y-m-d\TH:i:s',strtotime('-1 hour',strtotime($timeStamp)));
I then pass through the $bstTime for the "Timestamp" in the $urlVariables array.
At least it now works but could anyone help me identify what time setting is wrong on my server set up please? I do not really want to have to use this custom modification as I will no doubt need to remove my custom code when the clocks go back on 25th October 2020!!
Thanks as always,
There's probably a few things going on. The server account that you login with via SSH may be different from the account that PHP and/or Apache runs as, and they all can have different default timezone settings.
We let users specify the timezone under Admin > Settings > Regional Settings > Timezone Name. What this does is set PHP's default timezone with the date_default_timezone_set() function. This affects the date returned when you call PHP's date function.
Having a quick look at the Amazon SMS code it doesn't look like we're sending a timezone identifier. I suspect that if Amazon supported us sending a timezone as well that would resolve everything. Without that you'd need to connect to an amazon server that was in the same timezone as you or it's going to think your time is off.
Hope that helps, we'll take a look into this further and see if there's a patch we can add to resolve it.
Hope that helps!
Thanks for the reply.
I checked the settings in cmsb and my timezone is set to "Europe/London", which is what I want however I have just noticed it says "GMT+00:00" which is not correct as the clocks have gone forward by an hour. Is that a problem with the dropdown options you are offering?
I've resolved the issue with the Outgoing SMS plugin when using the AWS SNS service, the timestamp in the API call needed to be in UTC format, this is the reason it stopped working when the clocks changed. I've also added a new setting to the plugin that allows the SNS server to be changed easily. I've emailed you a copy of the updated plugin and will release it early next week.
I've also resolved the issue that was causing the timezone offset for Great Britain to be incorrect in the CMS General Settings menu, this fix will appear in the next CMS Builder release.
PHP Programmer - interactivetools.com