Example usage for java.util TimeZone setDefault

List of usage examples for java.util TimeZone setDefault

Introduction

In this page you can find the example usage for java.util TimeZone setDefault.

Prototype

public static void setDefault(TimeZone zone) 

Source Link

Document

Sets the TimeZone that is returned by the getDefault method.

Usage

From source file:com.infine.android.devoxx.ui.ScheduleFragment.java

private void setupDay(LayoutInflater inflater, long startMillis) {
    Day day = new Day();

    // Setup data
    day.index = mDays.size();/*from  w  ww. j  a v  a2 s  .  c  om*/
    day.timeStart = startMillis;
    day.timeEnd = startMillis + DateUtils.DAY_IN_MILLIS;
    day.blocksUri = ScheduleContract.Blocks.buildBlocksBetweenDirUri(day.timeStart, day.timeEnd);

    // Setup views
    day.rootView = (ViewGroup) inflater.inflate(R.layout.blocks_content, null);

    day.scrollView = (ObservableScrollView) day.rootView.findViewById(R.id.blocks_scroll);
    day.scrollView.setOnScrollListener(this);

    day.blocksView = (BlocksLayout) day.rootView.findViewById(R.id.blocks);
    day.nowView = day.rootView.findViewById(R.id.blocks_now);

    //      day.blocksView.setDrawingCacheEnabled(true);
    //      day.blocksView.setAlwaysDrawnWithCacheEnabled(true);

    TimeZone.setDefault(UIUtils.CONFERENCE_TIME_ZONE);
    day.label = DateUtils.formatDateTime(getActivity(), startMillis, TIME_FLAGS);

    mWorkspace.addView(day.rootView);
    mDays.add(day);
}

From source file:org.jfree.data.time.MillisecondTest.java

/**
 * Some checks for the getLastMillisecond() method.
 *///from  ww w.  j  av a2s.  c  o  m
@Test
public void testGetLastMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    TimeZone savedZone = TimeZone.getDefault();
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Millisecond m = new Millisecond(750, 1, 1, 1, 1, 1, 1970);
    assertEquals(61750L, m.getLastMillisecond());
    Locale.setDefault(saved);
    TimeZone.setDefault(savedZone);
}

From source file:org.jfree.data.time.junit.MinuteTest.java

/**
 * Some checks for the getLastMillisecond() method.
 *///w ww .  j a  v a  2 s. c om
public void testGetLastMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    TimeZone savedZone = TimeZone.getDefault();
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Minute m = new Minute(1, 1, 1, 1, 1970);
    assertEquals(119999L, m.getLastMillisecond());
    Locale.setDefault(saved);
    TimeZone.setDefault(savedZone);
}

From source file:org.jfree.data.time.junit.SecondTest.java

/**
 * Some checks for the getLastMillisecond() method.
 *//*  w w  w.  j  a  v  a  2 s. c  o m*/
public void testGetLastMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    TimeZone savedZone = TimeZone.getDefault();
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Second s = new Second(1, 1, 1, 1, 1, 1970);
    assertEquals(61999L, s.getLastMillisecond());
    Locale.setDefault(saved);
    TimeZone.setDefault(savedZone);
}

From source file:org.jfree.data.time.HourTest.java

/**
 * Some checks for the getLastMillisecond() method.
 *//*  w  ww .  ja v  a 2 s  .  c  om*/
@Test
public void testGetLastMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    TimeZone savedZone = TimeZone.getDefault();
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Hour h = new Hour(1, 1, 1, 1970);
    assertEquals(3599999L, h.getLastMillisecond());
    Locale.setDefault(saved);
    TimeZone.setDefault(savedZone);
}

From source file:org.dalmasso.ietfsched.ui.ScheduleFragment.java

private void setupDay(LayoutInflater inflater, long startMillis) {
    Day day = new Day();
    if (debbug)/*from   w  w w .ja v a  2s. c o  m*/
        Log.d(TAG, "Setup day");
    // Setup data
    day.index = mDays.size();
    day.timeStart = startMillis;
    day.timeEnd = startMillis + DateUtils.DAY_IN_MILLIS;
    day.blocksUri = ScheduleContract.Blocks.buildBlocksBetweenDirUri(day.timeStart, day.timeEnd);
    if (debbug)
        Log.d(TAG, "day block uri " + day.blocksUri);

    // Setup views
    day.rootView = (ViewGroup) inflater.inflate(R.layout.blocks_content, null);

    day.scrollView = (ObservableScrollView) day.rootView.findViewById(R.id.blocks_scroll);
    day.scrollView.setOnScrollListener(this);

    day.blocksView = (BlocksLayout) day.rootView.findViewById(R.id.blocks);
    day.nowView = day.rootView.findViewById(R.id.blocks_now);

    day.blocksView.setDrawingCacheEnabled(true);
    day.blocksView.setAlwaysDrawnWithCacheEnabled(true);

    TimeZone.setDefault(UIUtils.CONFERENCE_TIME_ZONE);
    day.label = DateUtils.formatDateTime(getActivity(), startMillis, TIME_FLAGS);

    mWorkspace.addView(day.rootView);
    mDays.add(day);
}

From source file:org.jfree.data.time.YearTest.java

/**
 * Some checks for the getLastMillisecond() method.
 *//*w w  w. ja v a 2  s.c  om*/
@Test
public void testGetLastMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    TimeZone savedZone = TimeZone.getDefault();
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Year y = new Year(1970);
    // TODO: Check this result...
    assertEquals(31532399999L, y.getLastMillisecond());
    Locale.setDefault(saved);
    TimeZone.setDefault(savedZone);
}

From source file:org.jfree.data.time.junit.MonthTest.java

/**
 * Some checks for the getFirstMillisecond() method.
 *//*from   w  ww  .  j  ava2 s .co  m*/
public void testGetFirstMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    TimeZone savedZone = TimeZone.getDefault();
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Month m = new Month(3, 1970);
    assertEquals(5094000000L, m.getFirstMillisecond());
    Locale.setDefault(saved);
    TimeZone.setDefault(savedZone);
}

From source file:org.jfree.data.time.junit.DayTest.java

/**
 * Some checks for the getFirstMillisecond() method.
 *//*ww  w  .  jav a  2s. c  o m*/
public void testGetFirstMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    TimeZone savedZone = TimeZone.getDefault();
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Day d = new Day(1, 3, 1970);
    assertEquals(5094000000L, d.getFirstMillisecond());
    Locale.setDefault(saved);
    TimeZone.setDefault(savedZone);
}

From source file:com.google.android.apps.iosched2.ui.ScheduleFragment.java

private void setupDay(LayoutInflater inflater, long startMillis) {
    Day day = new Day();

    // Setup data
    day.index = mDays.size();/*from  w  w  w . jav a 2  s  .  co  m*/
    day.timeStart = startMillis;
    day.timeEnd = startMillis + DateUtils.DAY_IN_MILLIS;
    day.blocksUri = ScheduleContract.Blocks.buildBlocksBetweenDirUri(day.timeStart, day.timeEnd);

    // Setup views
    day.rootView = (ViewGroup) inflater.inflate(R.layout.blocks_content, null);

    day.scrollView = (ObservableScrollView) day.rootView.findViewById(R.id.blocks_scroll);
    day.scrollView.setOnScrollListener(this);

    day.blocksView = (BlocksLayout) day.rootView.findViewById(R.id.blocks);
    day.nowView = day.rootView.findViewById(R.id.blocks_now);

    day.blocksView.setDrawingCacheEnabled(true);
    day.blocksView.setAlwaysDrawnWithCacheEnabled(true);

    TimeZone.setDefault(UIUtils.getConferenceTimeZone());
    day.label = DateUtils.formatDateTime(getActivity(), startMillis, TIME_FLAGS);

    mWorkspace.addView(day.rootView);
    mDays.add(day);
}