[Lazarus] Google Calendar API TEvent start or _end (TDatetime) question

Francesco Sammarco francesco.sammarco at gmail.com
Wed Jun 3 13:47:17 CEST 2020


Hi everyone, I have the following problem. I have a calendar (Italian) to
sync with Google Calendar. With the following code I can work quite well.
If today (2020-06-03) I set a new appointment it is saved on google
calendar on the right day and time, but if for example: always today if I
set an appointment for December 10, 2020 at 9 am, I find myself there
appointment set on the right day but at 8 am. (So an hour behind) I think
it's due to the change between sunlight and daylight. Can anyone explain to
me how to solve the problem?

Thank you
XinYiMan



var
   start_e  : TEventDateTime;
   end_e    : TEventDateTime;
   Entry    : TEvent;
begin
            Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId,
my_id_app);

                     start_e := TEventDateTime.Create();
                     end_e   := TEventDateTime.Create();

                     start_e.dateTime   := data_appuntamento;
                     start_e.dateTime   :=
LocalTimeToUniversal(start_e.dateTime);
                     start_e.timeZone   := 'Europe/Rome';

                     end_e.dateTime     :=
IncMinute(LocalTimeToUniversal(data_appuntamento),15);
                     end_e.timeZone     := 'Europe/Rome';

                     Entry.start                 := start_e;
                     Entry._end                  := end_e;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200603/0b5af3b5/attachment.html>


More information about the lazarus mailing list