I need to write a method to get day of week (pacific time) for current time. Is the following code correct?
static Calendar s_calendar = Calendar.getInstance(Locale.US);
static {
s_calendar.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
}
public static int getDayOfWeek() {
s_calendar.setTimeInMillis(System.currentTimeMillis());
return s_calendar.get(Calendar.DAY_OF_WEEK);
}
Thanks.