I don't believe this is possible with Apex since it runs on the server it has limited access to the client's browser and configuration. However you can access this with standard browser APIs and some Javascript using Intl.DateTimeFormat.prototype.resolvedOptions()
which will give you the IANA timezone name. There are also ways of accessing the timezone offset using Date.getTimezoneOffset()
.
let myTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
console.log(myTimezone); //America/New_York
let d = new Date(); //instantiates as current date & time
console.log(d.getTimezoneOffset()); //returns the offset, in minutes.
// So -60 => UTC+1, 480 => UTC-8
Bear in mind there's a chance that a user's browser is misconfigured and the time on their machine is not correct.