Day_light_offset for germany / Pass existing time as parameter? #130
Replies: 2 comments 1 reply
-
https://en.wikipedia.org/wiki/Daylight_saving_time You can set or update your device time yourself using NTP server or RTC chip before calling smtp or imap connect without to set session.time. |
Beta Was this translation helpful? Give feedback.
-
The settings from these 3 lines, session.time.ntp_server = "pool.ntp.org,time.nist.gov";
session.time.gmt_offset = xx;
session.time.day_light_offset = xx; are for system time setting via the function configTime. You can google for "esp8266 esp32 configTime". With the configTime function that available to use in the core library, you don't need other NTP libraries e.g. NTPtimeESP to set the time. Third party NTP time library may be required when you want more time accuracy for multiple devices synching operation. Why your device system time need to set when using this library?It is because RFC standard required the Date header to be set in the message envelope before sending the email. Then we use the system time to construct the valid Date header in mail sending only. If you don't set your device system time by any means, library will set it for you with GMT+0 and no day light saving offset. Alternatively, if you have the time read from RTC chip, you can set the system time with function settimeofday. You can google for "settimeofday" as found in Unix system too. If you have this such basic question, please spend the time to play with basic examples which are available in Arduino IDE or search google for how to set up esp8266 esp32 time or learning the basic things from community forum. |
Beta Was this translation helpful? Give feedback.
-
Hi mobitz,
i have two maybe stupid beginner questions:
First:
I live in germany so i guess i have to set gmt_offset to 1?
But what value do i have to set for day_light_offset? is there only 0 (no daylight saving) and 1?
Second question:
In this part of the example code:
session.time.ntp_server = "pool.ntp.org,time.nist.gov";
session.time.gmt_offset = 1;
session.time.day_light_offset = 1;
Is there a way to pass an already existing time and date as a parameter instead of requesting them again here?
Best wishes and thank you for this great library
Beta Was this translation helpful? Give feedback.
All reactions