Code example for TimeZone

Methods: getOffset

0
			try { 
				if (loc.hasAccuracy() && loc.getAccuracy() <= minAccuracyMeters) {
 
					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 "
									+ POINTS_TABLE_NAME
									+ " (GMTTIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,ACCURACY,SPEED,BEARING) VALUES (" 
									+ "'" 
									+ timestampFormat.format(greg.getTime())
									+ "'," 
									+ loc.getLatitude()
									+ "," 
									+ loc.getLongitude()
									+ "," 
									+ (loc.hasAltitude() ? loc.getAltitude()
Connect your IDE to all the code out there  Get Codota for Java