[…]I need to get local time and GMT time on Linux to get the difference between them and be able to make astronomical calculation.[…]
Since you wrote you wanna perform some astronomical calculations: What exactly do you mean by “local time”?
Astronomical calculations are always UTC (formerly, and colloquially, known as GMT) based. E.g.f you want to know the sun/moon up/down times or visibility of a constellation etc. for your local time you will have to convert.
That goes even for the local time in Greenwich, London. To correct for daylight savings time.
Local time in computing is time offset to UTC corrected for daylight savings time if applicable in defined zones measured in steps of 1 hour to the center of a zone, although there are many politically defined exceptions to that.
From UTC time and your geo-location it is of course possible to get an even more exact "local" time, but that is a different matter.
One hour of exact time difference corresponds to 15° of longitude. I live in the Netherlands (local GMT+2) , but my real time zone is GMT+ only 36 minutes
I live one degree north of Greenwich so now you know where I live