getRawOffset()
isn't static, so you can't call it on TimeZone
. Instead you need an actual TimeZone
object.
Probably something like:
int tzo = TimeZone.getDefault().getRawOffset();
Frage
I have a project that I need to determine the Time Zone for. The TimeZone class seems perfect for the task:
import java.util.TimeZone;
long tzo = TimeZone.getRawOffset();
However, The getRawOffset method is not available. What am I not understanding?
Lösung
getRawOffset()
isn't static, so you can't call it on TimeZone
. Instead you need an actual TimeZone
object.
Probably something like:
int tzo = TimeZone.getDefault().getRawOffset();