How to change GMT time on arduino

How can I change the GMT time with TinyGPS? It shows normally the time on my LCD but it is 2 hours earlier.

This is my code for printing the time on my LCD.

gps.get_datetime(&date, &time, &fix_age); sprintf(buf, "%06ld %08ld", date, time); lcd.LCD_write_string(0, 0, buf, MENU_HIGHLIGHT);

Do I have to change something on the TinyGPS library to change the GMT?

Thank you

Can you do this?

gps.get_datetime(&date, &time, &fix_age);
GMTtime = time manipulated somehow - like subtracting 5 from the hours portion
sprintf(buf, “%06ld %08ld”, date, GMTtime);
lcd.LCD_write_string(0, 0, buf, MENU_HIGHLIGHT);

I haven’t used the TinyGPS library but if I read it correctly it provides the time as an unsigned long number of milliseconds. So, adjusting that to Central European Time is:

  unsigned long fix_age,local_age;

  // Add two hours (in milliseconds)
  local_age = fix_age + 1000L*2*60*60;

Now convert local_age to a string and write to the LCD.
You’ll have to figure out how to handle daylight savings time though.


thank you guys for your help! I figured out how to do it

Share please - how'd you do it?