`
michael_yyz
  • 浏览: 38241 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

日期处理工具类

    博客分类:
  • java
 
阅读更多

package com.util;

import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;


/**
 * 日期处理工具类
 * @author dylan_xu
 * @date Mar 11, 2012
 * @modified by
 * @modified date
 * @since JDK1.6
 * @see com.util.DateUtil
 */

public class DateUtil {
	// ~ Static fields/initializers
	// =============================================

	private static Logger logger = Logger.getLogger(DateUtil.class);
	private static String defaultDatePattern = null;
	private static String timePattern = "HH:mm";
	private static Calendar cale = Calendar.getInstance();
	public static final String TS_FORMAT = DateUtil.getDatePattern() + " HH:mm:ss.S";
	/** 日期格式yyyy-MM字符串常量 */
	private static final String MONTH_FORMAT = "yyyy-MM";
	/** 日期格式yyyy-MM-dd字符串常量 */
	private static final String DATE_FORMAT = "yyyy-MM-dd";
	/** 日期格式HH:mm:ss字符串常量 */
	private static final String HOUR_FORMAT = "HH:mm:ss";
	/** 日期格式yyyy-MM-dd HH:mm:ss字符串常量 */
	private static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
	/** 某天开始时分秒字符串常量  00:00:00 */
	private static final String DAY_BEGIN_STRING_HHMMSS = " 00:00:00";
	/**  某天结束时分秒字符串常量  23:59:59  */
	public static final String DAY_END_STRING_HHMMSS = " 23:59:59";
	private static SimpleDateFormat sdf_date_format = new SimpleDateFormat(DATE_FORMAT);
	private static SimpleDateFormat sdf_hour_format = new SimpleDateFormat(HOUR_FORMAT);
	private static SimpleDateFormat sdf_datetime_format = new SimpleDateFormat(DATETIME_FORMAT);
	

	// ~ Methods
	// ================================================================

	public DateUtil() {
	}

	/**
	 * 获得服务器当前日期及时间,以格式为:yyyy-MM-dd HH:mm:ss的日期字符串形式返回
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getDateTime() {
		try {
			return sdf_datetime_format.format(cale.getTime());
		} catch (Exception e) {
			logger.debug("DateUtil.getDateTime():" + e.getMessage());
			return "";
		}
	}

	/**
	 * 获得服务器当前日期,以格式为:yyyy-MM-dd的日期字符串形式返回
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getDate() {
		try {
			return sdf_date_format.format(cale.getTime());
		} catch (Exception e) {
			logger.debug("DateUtil.getDate():" + e.getMessage());
			return "";
		}
	}

	/**
	 * 获得服务器当前时间,以格式为:HH:mm:ss的日期字符串形式返回
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getTime() {
		String temp = " ";
		try {
			temp += sdf_hour_format.format(cale.getTime());
			return temp;
		} catch (Exception e) {
			logger.debug("DateUtil.getTime():" + e.getMessage());
			return "";
		}
	}

	/**
	 * 统计时开始日期的默认值
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getStartDate() {
		try {
			return getYear() + "-01-01";
		} catch (Exception e) {
			logger.debug("DateUtil.getStartDate():" + e.getMessage());
			return "";
		}
	}

	/**
	 * 统计时结束日期的默认值
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getEndDate() {
		try {
			return getDate();
		} catch (Exception e) {
			logger.debug("DateUtil.getEndDate():" + e.getMessage());
			return "";
		}
	}

	/**
	 * 获得服务器当前日期的年份
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getYear() {
		try {
			return String.valueOf(cale.get(Calendar.YEAR));
		} catch (Exception e) {
			logger.debug("DateUtil.getYear():" + e.getMessage());
			return "";
		}
	}

	/**
	 * 获得服务器当前日期的月份
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getMonth() {
		try {
			java.text.DecimalFormat df = new java.text.DecimalFormat();
			df.applyPattern("00;00");
			return df.format((cale.get(Calendar.MONTH) + 1));
		} catch (Exception e) {
			logger.debug("DateUtil.getMonth():" + e.getMessage());
			return "";
		}
	}

	/**
	 * 获得服务器在当前月中天数
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getDay() {
		try {
			return String.valueOf(cale.get(Calendar.DAY_OF_MONTH));
		} catch (Exception e) {
			logger.debug("DateUtil.getDay():" + e.getMessage());
			return "";
		}
	}

	/**
	 * 比较两个日期相差的天数
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param date1
	 * @param date2
	 * @return
	 */
	public static int getMargin(String date1, String date2) {
		int margin;
		try {
			ParsePosition pos = new ParsePosition(0);
			ParsePosition pos1 = new ParsePosition(0);
			Date dt1 = sdf_date_format.parse(date1, pos);
			Date dt2 = sdf_date_format.parse(date2, pos1);
			long l = dt1.getTime() - dt2.getTime();
			margin = (int) (l / (24 * 60 * 60 * 1000));
			return margin;
		} catch (Exception e) {
			logger.debug("DateUtil.getMargin():" + e.toString());
			return 0;
		}
	}

	/**
	 * 比较两个日期相差的天数
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param date1
	 * @param date2
	 * @return
	 */
	public static double getDoubleMargin(String date1, String date2) {
		double margin;
		try {
			ParsePosition pos = new ParsePosition(0);
			ParsePosition pos1 = new ParsePosition(0);
			Date dt1 = sdf_datetime_format.parse(date1, pos);
			Date dt2 = sdf_datetime_format.parse(date2, pos1);
			long l = dt1.getTime() - dt2.getTime();
			margin = (l / (24 * 60 * 60 * 1000.00));
			return margin;
		} catch (Exception e) {
			logger.debug("DateUtil.getMargin():" + e.toString());
			return 0;
		}
	}

	/**
	 * 比较两个日期相差的月数
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param date1
	 * @param date2
	 * @return
	 */
	public static int getMonthMargin(String date1, String date2) {
		int margin;
		try {
			margin = (Integer.parseInt(date2.substring(0, 4)) - Integer.parseInt(date1.substring(0, 4))) * 12;
			margin += (Integer.parseInt(date2.substring(4, 7).replaceAll("-0",
					"-")) - Integer.parseInt(date1.substring(4, 7).replaceAll("-0", "-")));
			return margin;
		} catch (Exception e) {
			logger.debug("DateUtil.getMargin():" + e.toString());
			return 0;
		}
	}

	/**
	 * 返回日期加X天后的日期
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param date
	 * @param i
	 * @return
	 */
	public static String addDay(String date, int i) {
		try {
			GregorianCalendar gCal = new GregorianCalendar(
					Integer.parseInt(date.substring(0, 4)), 
					Integer.parseInt(date.substring(5, 7)) - 1, 
					Integer.parseInt(date.substring(8, 10)));
			gCal.add(GregorianCalendar.DATE, i);
			return sdf_date_format.format(gCal.getTime());
		} catch (Exception e) {
			logger.debug("DateUtil.addDay():" + e.toString());
			return getDate();
		}
	}

	/**
	 * 返回日期加X月后的日期
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param date
	 * @param i
	 * @return
	 */
	public static String addMonth(String date, int i) {
		try {
			GregorianCalendar gCal = new GregorianCalendar(
					Integer.parseInt(date.substring(0, 4)), 
					Integer.parseInt(date.substring(5, 7)) - 1, 
					Integer.parseInt(date.substring(8, 10)));
			gCal.add(GregorianCalendar.MONTH, i);
			return sdf_date_format.format(gCal.getTime());
		} catch (Exception e) {
			logger.debug("DateUtil.addMonth():" + e.toString());
			return getDate();
		}
	}

	/**
	 * 返回日期加X年后的日期
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param date
	 * @param i
	 * @return
	 */
	public static String addYear(String date, int i) {
		try {
			GregorianCalendar gCal = new GregorianCalendar(
					Integer.parseInt(date.substring(0, 4)), 
					Integer.parseInt(date.substring(5, 7)) - 1, 
					Integer.parseInt(date.substring(8, 10)));
			gCal.add(GregorianCalendar.YEAR, i);
			return sdf_date_format.format(gCal.getTime());
		} catch (Exception e) {
			logger.debug("DateUtil.addYear():" + e.toString());
			return "";
		}
	}

	/**
	 * 返回某年某月中的最大天
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param year
	 * @param month
	 * @return
	 */
	public static int getMaxDay(int iyear, int imonth) {
		int day = 0;
		try {
			if (imonth == 1 || imonth == 3 || imonth == 5 || imonth == 7
					|| imonth == 8 || imonth == 10 || imonth == 12) {
				day = 31;
			} else if (imonth == 4 || imonth == 6 || imonth == 9 || imonth == 11) {
				day = 30;
			} else if ((0 == (iyear % 4)) && (0 != (iyear % 100)) || (0 == (iyear % 400))) {
				day = 29;
			} else {
				day = 28;
			}
			return day;
		} catch (Exception e) {
			logger.debug("DateUtil.getMonthDay():" + e.toString());
			return 1;
		}
	}

	/**
	 * 格式化日期
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param orgDate
	 * @param Type
	 * @param Span
	 * @return
	 */
	@SuppressWarnings("static-access")
	public String rollDate(String orgDate, int Type, int Span) {
		try {
			String temp = "";
			int iyear, imonth, iday;
			int iPos = 0;
			char seperater = '-';
			if (orgDate == null || orgDate.length() < 6) {
				return "";
			}

			iPos = orgDate.indexOf(seperater);
			if (iPos > 0) {
				iyear = Integer.parseInt(orgDate.substring(0, iPos));
				temp = orgDate.substring(iPos + 1);
			} else {
				iyear = Integer.parseInt(orgDate.substring(0, 4));
				temp = orgDate.substring(4);
			}

			iPos = temp.indexOf(seperater);
			if (iPos > 0) {
				imonth = Integer.parseInt(temp.substring(0, iPos));
				temp = temp.substring(iPos + 1);
			} else {
				imonth = Integer.parseInt(temp.substring(0, 2));
				temp = temp.substring(2);
			}

			imonth--;
			if (imonth < 0 || imonth > 11) {
				imonth = 0;
			}

			iday = Integer.parseInt(temp);
			if (iday < 1 || iday > 31)
				iday = 1;

			Calendar orgcale = Calendar.getInstance();
			orgcale.set(iyear, imonth, iday);
			temp = this.rollDate(orgcale, Type, Span);
			return temp;
		} catch (Exception e) {
			return "";
		}
	}

	public static String rollDate(Calendar cal, int Type, int Span) {
		try {
			String temp = "";
			Calendar rolcale;
			rolcale = cal;
			rolcale.add(Type, Span);
			temp = sdf_date_format.format(rolcale.getTime());
			return temp;
		} catch (Exception e) {
			return "";
		}
	}

	/**
	 * 返回默认的日期格式
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static synchronized String getDatePattern() {
		defaultDatePattern = "yyyy-MM-dd";
		return defaultDatePattern;
	}

	/**
	 * 将指定日期按默认格式进行格式代化成字符串后输出如:yyyy-MM-dd
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param aDate
	 * @return
	 */
	public static final String getDate(Date aDate) {
		SimpleDateFormat df = null;
		String returnValue = "";
		if (aDate != null) {
			df = new SimpleDateFormat(getDatePattern());
			returnValue = df.format(aDate);
		}
		return (returnValue);
	}

	/**
	 * 取得给定日期的时间字符串,格式为当前默认时间格式
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param theTime
	 * @return
	 */
	public static String getTimeNow(Date theTime) {
		return getDateTime(timePattern, theTime);
	}

	/**
	 * 取得当前时间的Calendar日历对象
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 * @throws ParseException
	 */
	public Calendar getToday() throws ParseException {
		Date today = new Date();
		SimpleDateFormat df = new SimpleDateFormat(getDatePattern());
		String todayAsString = df.format(today);
		Calendar cal = new GregorianCalendar();
		cal.setTime(convertStringToDate(todayAsString));
		return cal;
	}

	/**
	 * 将日期类转换成指定格式的字符串形式
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param aMask
	 * @param aDate
	 * @return
	 */
	public static final String getDateTime(String aMask, Date aDate) {
		SimpleDateFormat df = null;
		String returnValue = "";

		if (aDate == null) {
			logger.error("aDate is null!");
		} else {
			df = new SimpleDateFormat(aMask);
			returnValue = df.format(aDate);
		}
		return (returnValue);
	}

	/**
	 * 将指定的日期转换成默认格式的字符串形式
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param aDate
	 * @return
	 */
	public static final String convertDateToString(Date aDate) {
		return getDateTime(getDatePattern(), aDate);
	}

	/**
	 * 将日期字符串按指定格式转换成日期类型
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param aMask 指定的日期格式,如:yyyy-MM-dd
	 * @param strDate 待转换的日期字符串
	 * @return
	 * @throws ParseException
	 */
	public static final Date convertStringToDate(String aMask, String strDate)
			throws ParseException {
		SimpleDateFormat df = null;
		Date date = null;
		df = new SimpleDateFormat(aMask);

		if (logger.isDebugEnabled()) {
			logger.debug("converting '" + strDate + "' to date with mask '" + aMask + "'");
		}
		try {
			date = df.parse(strDate);
		} catch (ParseException pe) {
			logger.error("ParseException: " + pe);
			throw pe;
		}
		return (date);
	}

	/**
	 * 将日期字符串按默认格式转换成日期类型
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param strDate
	 * @return
	 * @throws ParseException
	 */
	public static Date convertStringToDate(String strDate)
			throws ParseException {
		Date aDate = null;

		try {
			if (logger.isDebugEnabled()) {
				logger.debug("converting date with pattern: " + getDatePattern());
			}
			aDate = convertStringToDate(getDatePattern(), strDate);
		} catch (ParseException pe) {
			logger.error("Could not convert '" + strDate + "' to a date, throwing exception");
			throw new ParseException(pe.getMessage(), pe.getErrorOffset());
		}
		return aDate;
	}

	/**
	 * 返回一个JAVA简单类型的日期字符串
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	public static String getSimpleDateFormat() {
		SimpleDateFormat formatter = new SimpleDateFormat();
		String NDateTime = formatter.format(new Date());
		return NDateTime;
	}
	
	/**
	 * 将指定字符串格式的日期与当前时间比较
	 * @author DYLAN
	 * @date Feb 17, 2012
	 * @param strDate 需要比较时间
	 * @return 
	 * 		<p>
	 * 		int code
	 * 		<ul>
	 * 		<li>-1 当前时间 < 比较时间 </li>
	 * 		<li> 0 当前时间 = 比较时间 </li>
	 * 		<li>>=1当前时间 > 比较时间 </li>
	 * 		</ul>
	 * 		</p>
	 */
	public static int compareToCurTime (String strDate) {
		if (StringUtils.isBlank(strDate)) {
			return -1;
		}
		Date curTime = cale.getTime();
		String strCurTime = null;
		try {
			strCurTime = sdf_datetime_format.format(curTime);
		} catch (Exception e) {
			if (logger.isDebugEnabled()) {
				logger.debug("[Could not format '" + strDate + "' to a date, throwing exception:" + e.getLocalizedMessage() + "]");
			}
		}
		if (StringUtils.isNotBlank(strCurTime)) {
			return strCurTime.compareTo(strDate);
		}
		return -1;
	}
	
	/**
	 * 为查询日期添加最小时间
	 * 
	 * @param 目标类型Date
	 * @param 转换参数Date
	 * @return
	 */
	@SuppressWarnings("deprecation")
	public static Date addStartTime(Date param) {
		Date date = param;
		try {
			date.setHours(0);
			date.setMinutes(0);
			date.setSeconds(0);
			return date;
		} catch (Exception ex) {
			return date;
		}
	}

	/**
	 * 为查询日期添加最大时间
	 * 
	 * @param 目标类型Date
	 * @param 转换参数Date
	 * @return
	 */
	@SuppressWarnings("deprecation")
	public static Date addEndTime(Date param) {
		Date date = param;
		try {
			date.setHours(23);
			date.setMinutes(59);
			date.setSeconds(0);
			return date;
		} catch (Exception ex) {
			return date;
		}
	}

	/**
	 * 返回系统现在年份中指定月份的天数
	 * 
	 * @param 月份month
	 * @return 指定月的总天数
	 */
	@SuppressWarnings("deprecation")
	public static String getMonthLastDay(int month) {
		Date date = new Date();
		int[][] day = { { 0, 30, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
				{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } };
		int year = date.getYear() + 1900;
		if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
			return day[1][month] + "";
		} else {
			return day[0][month] + "";
		}
	}

	/**
	 * 返回指定年份中指定月份的天数
	 * 
	 * @param 年份year
	 * @param 月份month
	 * @return 指定月的总天数
	 */
	public static String getMonthLastDay(int year, int month) {
		int[][] day = { { 0, 30, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
				{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } };
		if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
			return day[1][month] + "";
		} else {
			return day[0][month] + "";
		}
	}

	/**
	 * 判断是平年还是闰年
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @param year
	 * @return
	 */	
	public static boolean isLeapyear(int year) {
		if ((year % 4 == 0 && year % 100 != 0) || (year % 400) == 0) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * 取得当前时间的日戳
	 * @author dylan_xu
	 * @date Mar 11, 2012
	 * @return
	 */
	@SuppressWarnings("deprecation")
	public static String getTimestamp() {
		Date date = cale.getTime();
		String timestamp = "" + (date.getYear() + 1900) + date.getMonth()
				+ date.getDate() + date.getMinutes() + date.getSeconds()
				+ date.getTime();
		return timestamp;
	}

	/**
	 * 取得指定时间的日戳
	 * 
	 * @return
	 */
	@SuppressWarnings("deprecation")
	public static String getTimestamp(Date date) {
		String timestamp = "" + (date.getYear() + 1900) + date.getMonth()
				+ date.getDate() + date.getMinutes() + date.getSeconds()
				+ date.getTime();
		return timestamp;
	}

	public static void main(String[] args) {
		System.out.println(getYear() + "|" + getMonth() + "|" + getDate());
	}
}
 
分享到:
评论

相关推荐

    UTILS_日期处理工具类_

    "UTILS_日期处理工具类_" 提供了一组用嵌入式语言实现的日期处理工具代码,帮助开发者更方便地进行时间相关的操作。下面我们将详细探讨这个工具类包含的主要知识点。 1. **日期和时间基础**: - 在编程中,日期和...

    Java日期处理工具类

    基本涵盖了各种场景的日期处理需要,包括时间类型转换,获取N天前后,月初月末,某段时间按天拆分等功能,欢迎使用。

    js 日期处理工具类

    js 日期处理工具类,实现了日期的转换,日期格式: 30分钟前,16:20,昨天 11:11、11-17 10:10,等格式。

    swift-Swift的现实世界日期处理工具类

    本篇文章将深入探讨Swift中的日期处理工具类,以及如何在实际项目中有效利用它们。 首先,Swift的`Date`类代表一个时间点,通常是一个全球协调时间(UTC)。这个类是不可变的,意味着所有基于`Date`的操作都不会...

    java 日期处理工具类

    java 日期处理工具类

    安卓开发框架工具类相关-很实用的安卓开发工具类开发必备日期处理工具类IO流转换工具类打印日志工具类屏幕字符串工具类Toast工具类弹框工具类.zip

    很实用的安卓开发工具类,开发必备,日期处理工具类,IO流转换工具类,打印日志工具类,屏幕,字符串工具类,Toast工具类,弹框工具类.zip,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。

    java日期处理工具类

    日期操作工具类,主要实现了日期的常用操作。 * * 在工具类中经常使用到工具类的格式化描述,这个主要是一个日期的操作类,所以日志格式主要使用 SimpleDateFormat的定义格式. * * 格式的意义如下: 日期和...

    最全Java常用日期处理工具类

    2014" 专门用于处理springboard定时任务修改cron参数的日期处理方法 12.获取本月第一天(月初时间) 13.获取本月最后一天(月底时间) 以上这些方法都在该Java工具类,当然不仅仅包含这些,还有其他的很多。

    Java中封装的全局日期处理工具类

    获取日期中的某数值。如获取月份 增加日期中某类型的某数值。如增加日期 获取精确的日期 判断字符串是否为日期字符串 获取日期字符串的日期风格。失敗返回null。 将日期字符串转化为日期。失败返回null。 ...

    DateUtil日期处理工具类

    日期操作工具类,String转Long,String转Date,Date转String,Date转Long,Long转Date,Long转String等

    超好用的日期处理工具类

    超好用的时间工具类,包括时间各种格式转换,时间字符串互相转,时间增加,时间减去,单独获取日,获取月,获取时间等

    农历(阴历)日期处理工具类

    本篇文章将介绍一个名为"LunarCalendar"的Java工具类,它专门用于农历日期的处理。 首先,我们来看`LunarCalendar`这个类的基本结构。这个类通常会包含一系列的内部数据结构来表示农历的年、月、日,可能还包括时、...

    DateUtil.java 时间日期处理工具类

    包含"yyyy-MM-dd"、"yyyy-MM-dd HH:mm:ss"、"yyyyMMdd"、"yyyyMMddHHmmss"、"yyyy-MM"、"yyyyMM"等时间格式的转换。 其中: 1.String转Timestamp stringToTimestamp(String dateStr); 2.比较传入时间与当前时间前一...

    Java日期处理工具类DateUtils详解

    Java日期处理工具类DateUtils详解 Java日期处理工具类DateUtils是Java中一个非常有用的工具类,它提供了一系列日期和时间处理相关的操作,涵盖了日期和时间的格式化、解析、计算等多方面的内容。本文将详细介绍...

    Android快速开发系列 10个常用工具类 程序源码

    2. **DateUtil**: 时间日期处理工具类,通常包含将日期格式化为字符串,字符串转换为日期,计算两个日期之间的差值等功能。在Android开发中,这类工具类能帮助开发者更好地管理和展示时间数据。 3. **BitmapUtil**:...

Global site tag (gtag.js) - Google Analytics