Code example for TimeZone

Methods: getOffset

0
 
				if (threshold < netForce) {
					try { 
						GregorianCalendar greg = new GregorianCalendar();
						TimeZone tz = greg.getTimeZone();
						int offset = tz.getOffset(System.currentTimeMillis());
						greg.add(Calendar.SECOND, (offset / 1000) * -1);
						StringBuffer queryBuf = new StringBuffer();
						queryBuf.append("INSERT INTO ACCELERATION "
								+ " (GMTTIMESTAMP,X1,X2,X3) VALUES (" + "'" 
								+ timestampFormat.format(greg.getTime()) + "',"
								+ event.values[0] + "," + event.values[1] + ","
								+ event.values[2] + ");");
 
						db = openOrCreateDatabase(DATABASE_NAME,
								SQLiteDatabase.OPEN_READWRITE, null);
						db.execSQL(queryBuf.toString());
					} catch (Exception e) {
 
					} finally { 
						if (db.isOpen())