If unix timestamp is the same across the world how is am I able to get local time.
Or is it based on the different timezones the timestamp is different. i.e. I am in US the current seconds from UTC 1970 is 5,000 but if I am in Asia and check timestamp it will be 4,000 seconds ?
UTC is the same for every country in the world, whether you check in the US or in Asia the value will be the same.
Local time is calculated by using a time-zone offset (usually provided through the IANA time zone database). This is added to UTC time to determine the "Local Time" since 1970.