package com.example.mountaintravel.variable;

import java.text.SimpleDateFormat;
import java.util.Date;


public class Variable {
	public static String JSESSIONID = "";
	public static final String address = "gwms.517gts.com";
	//public static String nick_name = "";
	public static boolean updata = false;
	public static boolean ifOpen = false;// 侧滑菜单有没有打开标识
	public static boolean touch = false;
	public static String className = "";
	public static String myPointX = "";
	public static String myPointY = "";
	public static String URL_GTS = "http://gwms.517gts.com/terminal/findMapAreaInfoByWhere";
	// public static String URL_GTS =
	// "http://192.168.20.70:5050/gts/terminal/findMapAreaInfoByWhere";
	//public static final String address = "192.168.20.57:5050/gts";
	// public static final String address = "192.168.20.52:5050/gts";
	/*
	 * 标记是不是竞赛页未登录跳转的标识
	 */
	public static int recLen1 = 0;
	public static int recLen2 = 0;
	public static int recLen3 = 0;
	public static int recLen4 = 0;
	public static int recLen5 = 0;
	public static int recLen6 = 0;
	// time转long
	public static String getTime(String user_time) {
		String re_time = null;
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
		Date d;
		try {
			d = sdf.parse(user_time);
			long l = d.getTime();
			String str = String.valueOf(l);
			re_time = str.substring(0, 10);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return re_time;
	}

	// long转time
	public static String getStrTime(String time) {
		String re_StrTime = null;
		SimpleDateFormat sdf = null;
		if (time.equals("")) {
			return "";
		}
		sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		long loc_time = Long.valueOf(time);
		re_StrTime = sdf.format(new Date(loc_time * 1000L));
		return re_StrTime;
	}

	public static String getStrTime3(String time) {
		String re_StrTime = null;
		SimpleDateFormat sdf = null;
		if (time.equals("")) {
			return "";
		}
		sdf = new SimpleDateFormat("yyyy-MM-dd");
		long loc_time = Long.valueOf(time);
		re_StrTime = sdf.format(new Date(loc_time * 1000L));
		return re_StrTime;
	}

	// long转time
	public static String getStrTime2(String time) {
		String re_StrTime = null;
		SimpleDateFormat sdf = null;
		if (time.equals("")) {
			return "";
		}
		sdf = new SimpleDateFormat("yyyyMMddHHmmss");
		long loc_time = Long.valueOf(time);
		re_StrTime = sdf.format(new Date(loc_time * 1000L));
		return re_StrTime;
	}
	// public static String getSesskey() {
	// return sesskey;
	// }
	// public static void setSesskey(String sesskey) {
	// Variable.sesskey = sesskey;
	// }
	// public static String getJSESSIONID() {
	// return JSESSIONID;
	// }
	// public static void setJSESSIONID(String jSESSIONID) {
	// JSESSIONID = jSESSIONID;
	// }
}
