Package java.util

Examples of java.util.TimeZone$DisplayNames


  private static Logger logger = Logger.getLogger(PopupCalendar.class);
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
      String Final_Forward = ".view.calendar.popup.calendar";
     
      TimeZone tz = TimeZone.getTimeZone("EST");
      GregorianCalendar startTimeUser = new GregorianCalendar(tz);
      startTimeUser.setFirstDayOfWeek(Calendar.MONDAY);
      startTimeUser.setTimeInMillis(System.currentTimeMillis());
      int currentDay = startTimeUser.get(Calendar.DATE);
      int currentMonth = startTimeUser.get(Calendar.MONTH);
View Full Code Here


    this.memberValue = memberValue;
  }
 
  public Date applyTimeZone(Date ds, String timezoneid)
  {
    TimeZone tz = TimeZone.getTimeZone(timezoneid);
    long ls = ds.getTime();
    int startoffset = tz.getOffset(ls);
    ls = ls + startoffset;
    ds = new Date(ls);
    return ds;
  }
View Full Code Here

      activityTypeVec.add(new DDNameValue("Task", "Task"));
      request.setAttribute("activityTypeVec", activityTypeVec);

      // What the hell??? what is the purpose of the default values here?
      int timespan = 30;
      TimeZone tz = null;

      // get time zone from parameter or from preferences; worst case default to
      // EST.
      try {
        if (request.getParameter("timeZone") != null) {
          tz = TimeZone.getTimeZone(request.getParameter("timeZone"));
        } else {
          tz = TimeZone.getTimeZone((userobject.getUserPref()).getTimeZone());
        }
      } catch (Exception e) {
        tz = TimeZone.getTimeZone("EST");
      }
      request.setAttribute("TZ", tz);

      GlobalMasterLists globalMasterLists = GlobalMasterLists.getGlobalMasterLists(dataSource);
      Vector timeZoneVec = (Vector) globalMasterLists.get("TimeZone");
      request.setAttribute("timeZoneVec", timeZoneVec);
      String timeZoneID = tz.getID();
      calendardyna.set("timeZone", timeZoneID);

      request.setAttribute("showAdvancedSearch", new Boolean(false));
      request.setAttribute("showCustomViews", new Boolean(false));
      request.setAttribute("showComposeButton", new Boolean(false));
View Full Code Here

      Date today = new Date();
      // this is used to prevent duplicates in the list
      ArrayList descriptionList = new ArrayList();
      String[] zoneIds = TimeZone.getAvailableIDs();
      for (int i=0; i<zoneIds.length; i++) {
        TimeZone tz = TimeZone.getTimeZone(zoneIds[i]);
        String shortName = tz.getDisplayName(tz.inDaylightTime(today), TimeZone.SHORT);
        String longName = tz.getDisplayName(tz.inDaylightTime(today), TimeZone.LONG);
        int offset = tz.getOffset(today.getTime());
        int hour = offset / (60*60*1000);
        int min = Math.abs(offset / (60*1000)) % 60;
        StringBuffer description = new StringBuffer();
        description.append(shortName+": ");
        description.append(longName);
View Full Code Here

  {
    Calendar calendar;
    HttpSession session = request.getSession(true);
    UserObject user = (UserObject)session.getAttribute("userobject");
    UserPrefererences prefs = user.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(prefs.getTimeZone());
    Locale locale = request.getLocale();
    // If current time requested get the system instance
    if (current) {
      calendar = Calendar.getInstance(tz, locale);
    } else {
View Full Code Here

   * @return
   */
  public static Calendar getCalendar(int individualId, String dataSource, boolean current)
  {
    Calendar calendar;
    TimeZone tz = null;
    try {
      PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject(
          "com.centraview.preference.PreferenceHome", "Preference");
      Preference prefRemote = prefHome.create();
      prefRemote.setDataSource(dataSource);
View Full Code Here

    String dataSource = Settings.getInstance().getSiteInfo(
        CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession(true);
    UserObject userObject = (UserObject)session.getAttribute("userobject");
    UserPrefererences prefs = userObject.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(prefs.getTimeZone());
    Locale locale = request.getLocale();
   
    PopulateForm populateForm = new PopulateForm();
    // set the form elements
    populateForm.setForm(request, form);
View Full Code Here

        // In the case the start time wasn't requested from the parent window,
        // set the start time to now() rounded up to the nearest hour, and the
        // end time to be the start time plus 1 hour.
        UserPrefererences userPref = userObject.getUserPref();
        String userTimeZoneId = userPref.getTimeZone();
        TimeZone userTimeZone = TimeZone.getTimeZone(userTimeZoneId);
        Calendar now = Calendar.getInstance(userTimeZone, locale);
        // round up the hour if we are at the 1 minute mark of the hour or
        // higher. just clear the second and millisecond fields, its only
        // scheduling not physics.
        now.clear(Calendar.SECOND);
View Full Code Here

        Connection conn = getConnection(db);
        Statement stat;
        stat = conn.createStatement();
        stat.execute("create table date_list(tz varchar, t varchar, ts timestamp)");
        conn.close();
        TimeZone defaultTimeZone = TimeZone.getDefault();
        ArrayList<TimeZone> distinct = TestDate.getDistinctTimeZones();
        try {
            for (TimeZone tz : distinct) {
                println("insert using " + tz.getID());
                TimeZone.setDefault(tz);
View Full Code Here

        ValueTimestamp.parse(year + "-" + month + "-" + day + " " + hour + ":00:00");
    }

    private void testAllTimeZones() throws SQLException {
        Connection conn = getConnection("date");
        TimeZone defaultTimeZone = TimeZone.getDefault();
        PreparedStatement prep = conn.prepareStatement("CALL CAST(? AS DATE)");
        try {
            ArrayList<TimeZone> distinct = TestDate.getDistinctTimeZones();
            for (TimeZone tz : distinct) {
                println(tz.getID());
View Full Code Here

TOP

Related Classes of java.util.TimeZone$DisplayNames

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.