<div dir="auto"><span style="color:rgb(60,64,67);font-family:roboto,helveticaneue,arial,sans-serif;font-size:small;background-color:rgb(255,255,255)">sorry I don't understand, you say that just remove the lines where I specify the timezone ?!</span></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il mer 3 giu 2020, 14:51 Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Wed, 3 Jun 2020, Francesco Sammarco via lazarus wrote:<br>
<br>
> Hi everyone, I have the following problem. I have a calendar (Italian) to<br>
> sync with Google Calendar. With the following code I can work quite well.<br>
> If today (2020-06-03) I set a new appointment it is saved on google<br>
> calendar on the right day and time, but if for example: always today if I<br>
> set an appointment for December 10, 2020 at 9 am, I find myself there<br>
> appointment set on the right day but at 8 am. (So an hour behind) I think<br>
> it's due to the change between sunlight and daylight. Can anyone explain to<br>
> me how to solve the problem?<br>
><br>
> Thank you<br>
> XinYiMan<br>
><br>
><br>
><br>
> var<br>
> start_e : TEventDateTime;<br>
> end_e : TEventDateTime;<br>
> Entry : TEvent;<br>
> begin<br>
> Entry := FCalendarAPI.EventsResource.Get(CalendarFindedId,<br>
> my_id_app);<br>
><br>
> start_e := TEventDateTime.Create();<br>
> end_e := TEventDateTime.Create();<br>
><br>
> start_e.dateTime := data_appuntamento;<br>
> start_e.dateTime :=<br>
> LocalTimeToUniversal(start_e.dateTime);<br>
> start_e.timeZone := 'Europe/Rome';<br>
<br>
If you set the timzeone explicitly, I don't think you must do a LocalTimeToUniversal, <br>
I think the timezone is then automatically taken into account. As I<br>
understand it you specify the timezone in dateTime or you set it in the<br>
timezone.<br>
<br>
Michael.<br>
</blockquote></div>