Examples of TimeZone


Examples of java.util.TimeZone

        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

Examples of java.util.TimeZone

        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

Examples of java.util.TimeZone

        this.timeZone = tz;
      }
      @Override
      protected Calendar initialValue() {
            if(this.timeZone != null && this.timeZone.trim().length() > 0) {
              TimeZone tz = TimeZone.getTimeZone(this.timeZone);
                if(!DEFAULT_TIME_ZONE.hasSameRules(tz)) {
                return Calendar.getInstance(tz);
                }
            }         
        return Calendar.getInstance();
View Full Code Here

Examples of java.util.TimeZone

    String sessionID = requestForm.getSessionID();
    HttpSession session = request.getSession();
    UserObject userobjectd = (UserObject)session.getAttribute("userobject");
    UserPrefererences userPrefs = userobjectd.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(userPrefs.getTimeZone());
    Locale locale = request.getLocale();
    int individualID = userobjectd.getIndividualID();
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    // date format for writing to the form should be in the format based on
    // locale
View Full Code Here

Examples of java.util.TimeZone

    // First setup for all the work
    HttpSession session = request.getSession(true);
    UserObject user = (UserObject)session.getAttribute("userobject");
    int individualId = user.getIndividualID();
    TimeZone tz = TimeZone.getTimeZone((user.getUserPref()).getTimeZone());

    //UserPrefererences preferences = user.getUserPref();

    GregorianCalendar startTime = new GregorianCalendar(tz, locale);
    startTime.setTime(Calendar.getInstance().getTime());
View Full Code Here

Examples of java.util.TimeZone

    HttpSession session = request.getSession();
    UserObject userobjectd = (UserObject)session.getAttribute("userobject");

    // get the user's preference for sync'ing as private or default privileges
    UserPrefererences userPrefs = userobjectd.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(userPrefs.getTimeZone());
    Locale locale = request.getLocale();
    String prefValue = userPrefs.getSyncAsPrivate();
    boolean syncAsPrivate = (prefValue != null && prefValue.equals("YES")) ? true : false;

    // date format for incoming dates: 2004-01-13 15:00:00
View Full Code Here

Examples of java.util.TimeZone

    int numChannels = Integer.parseInt(settings.getProperty("NumberOfChannels", "0"));

    mChannels = new ArrayList<Channel>();

    TimeZone timeZone = TimeZone.getTimeZone("GMT+0:00");
    for (int i = 0; i < numChannels; i++) {
      String channelName = settings.getProperty("ChannelTitle-" + i, "");
      String channelId = settings.getProperty("ChannelId-" + i, "");
      Channel ch = new Channel(this, channelName, channelId, timeZone, "gb", "(c) Radio Times", "http://www.radiotimes.co.uk", mRadioTimesChannelGroup);
      mChannels.add(ch);
View Full Code Here

Examples of java.util.TimeZone

        int numChannels = Integer.parseInt(settings.getProperty("NumberOfChannels", "0"));

        mChannels = new ArrayList<Channel>();

        TimeZone timeZone = TimeZone.getTimeZone("GMT+1:00");
        for (int i = 0; i < numChannels; i++) {
            Channel ch = new Channel(this, settings.getProperty("ChannelTitle-" + i, ""), settings.getProperty("ChannelId-"
                    + i, ""), timeZone, "de", "Imported from Dreambox", "", mChannelGroup, null, Channel.CATEGORY_TV);

            mChannels.add(ch);
View Full Code Here

Examples of java.util.TimeZone

        Calendar regular = Calendar.getInstance();
        Calendar other = null;
        // search a locale that has a _different_ raw offset
        long testTime = java.sql.Date.valueOf("2001-02-03").getTime();
        for (String s : TimeZone.getAvailableIDs()) {
            TimeZone zone = TimeZone.getTimeZone(s);
            long rawOffsetDiff = regular.getTimeZone().getRawOffset() - zone.getRawOffset();
            // must not be the same timezone (not 0 h and not 24 h difference
            // as for Pacific/Auckland and Etc/GMT+12)
            if (rawOffsetDiff != 0 && rawOffsetDiff != 1000 * 60 * 60 * 24) {
                if (regular.getTimeZone().getOffset(testTime) != zone.getOffset(testTime)) {
                    other = Calendar.getInstance(zone);
                    break;
                }
            }
        }
View Full Code Here

Examples of java.util.TimeZone

            }
        }
    }

    private void testCalculateLocalMillis() {
        TimeZone defaultTimeZone = TimeZone.getDefault();
        try {
            for (TimeZone tz : TestDate.getDistinctTimeZones()) {
                TimeZone.setDefault(tz);
                for (int y = 1900; y < 2039; y += 10) {
                    if (y == 1993) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.