前言

最近老被小伙伴戳;其实这些都是些很基础的东西,一边完善工具类;一边整理一下关于date的常见运用;以后使用起来就不需要到处去找了;争取做到想要的这儿都有。

正文


private static final String TYPE = "yyyy-MM-dd HH:mm";
public static final long ONEDAY_TIME=24*60*60*1000L; /**
* 返回当前时间+天数
* @param nowTime 2019-01-01)
* @param number 3
* @return 2019-01-04 00:00:00
*/
public static String after(String nowTime, Integer number)
{
String time = "";
String pattern = "yyyy-MM-dd";
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Date now = null;
try
{
now = sdf.parse(nowTime);
}
catch (ParseException e)
{
e.printStackTrace();
}
Calendar c = Calendar.getInstance();
c.setTime(now);
c.add(Calendar.DAY_OF_MONTH, number);
time = c.get(c.YEAR) + "-" + ((c.get(Calendar.MONTH) + 1) < 10 ? "0" + (c.get(Calendar.MONTH) + 1) : (c.get(Calendar.MONTH) + 1)) + "-" + (c.get(Calendar.DAY_OF_MONTH) < 10 ? "0" + c.get(Calendar.DAY_OF_MONTH) :
c.get(Calendar.DAY_OF_MONTH)) + " " + (c.get(Calendar.HOUR_OF_DAY) < 10 ? "0" + c.get(Calendar.HOUR_OF_DAY) : c.get(Calendar.HOUR_OF_DAY)) + ":" + (c.get(Calendar.MINUTE) < 10 ? "0" + c.get(Calendar.MINUTE) : c.get(Calendar.MINUTE)) +
":" +
(c.get(Calendar.SECOND) < 10 ? "0" + c.get(Calendar.SECOND) : c.get(Calendar.SECOND));
return time;
} /**
* 当前时间
*
* @param data
* @return
*/
public static String timeToString(Date date)
{
String pattern = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format(date);
} /**
* String转成规定格式
*
* @param data
* @param pattern
* @return
*/
public static String stringToTime(String data, String pattern) throws Exception
{
DateFormat fmt = new SimpleDateFormat(pattern);
Date date = fmt.parse(data);
return fmt.format(date);
} /**
* 两个时间相减
*
* @param startTime
* @param endTime
* @return
*/
public static double jisuan(String startTime, String endTime, String pattern) throws Exception
{
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Date start = sdf.parse(startTime);
Date end = sdf.parse(endTime);
long cha = end.getTime() - start.getTime();
double result = cha * 1.0 / (1000 * 60 * 60);
return result;
} /**
* 返回固定长度的数字
*
* @param strLength
* @return
*/
public static String getFixLenthString(int strLength)
{
Random rm = new Random();
// 获得随机数
double pross = (1 + rm.nextDouble()) * Math.pow(10, strLength); // 将获得的获得随机数转化为字符串
String fixLenthString = String.valueOf(pross); // 返回固定的长度的随机数
return fixLenthString.substring(1, strLength + 1);
} /**
* 生成随即的名字
*
* @param fileName
* @return
*/
public static String generateFileName(String fileName)
{
String formatDate = new SimpleDateFormat("yyMMddHHmmss").format(new Date());
int random = new Random().nextInt(10000);
int position = fileName.lastIndexOf(".");
String extension = fileName.substring(position);
return formatDate + random + extension;
} /**
* 把时间格式字符串转化为date
* @param date
* @param pattern
* @return
* @throws ParseException
*/
public static Date formateDate (String date, String pattern) throws ParseException {
return new SimpleDateFormat(pattern).parse(date);
} /**
* 获取当前年月,格式:yyyyMM
* @return java.lang.String
*/
public static String getYearAndMonth() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMM");
Date currentTime = new Date();
String date = formatter.format(currentTime);
return date;
} /**
* 获取当前年月,格式:yyyyMM
* @return java.lang.String
*/
public static String getYearAndMonth(Date date) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMM");
String sdate = formatter.format(date);
return sdate;
} /**
* 获取当前年月,格式:yyyy-MM
* @return java.lang.String
*/
public static String getYearAndMonthForSql() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
Date currentTime = new Date();
String date = formatter.format(currentTime);
return date;
} /**
* 获取当前年月,格式:yyyy-MM
* @return java.lang.String
*/
public static String getYearAndMonthForSql(Date currentTime) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
String date = formatter.format(currentTime);
return date;
} /**
* 获取当前年月,格式:yyyyMMdd
* @return java.lang.String
*/
public static String getYearAndMonthAndDay() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
Date currentTime = new Date();
String date = formatter.format(currentTime);
return date;
} /**
* 将传入日期转换为"yyyy-MM-dd HH:mm:ss"
* @return java.lang.String
*/
public static String DateToLongString(Date date) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateStr = formatter.format(date);
return dateStr;
} /**
* 将传入日期转换为"yyyy-MM-dd"
* @return java.lang.String
*/
public static String DateToShortString(Date dateStr) {
SimpleDateFormat clsFormat = new SimpleDateFormat("yyyy-MM-dd");
String returnString = new String("");
returnString = clsFormat.format(dateStr);
return returnString;
} /**
* 将传入日期转换为"MM-dd"
* @return java.lang.String
*/
public static String DateToMonthAndDayString(Date dateStr) {
SimpleDateFormat clsFormat = new SimpleDateFormat("MM-dd");
String returnString = new String("");
returnString = clsFormat.format(dateStr);
return returnString;
} /**
* 将传入日期转换为"MM月dd日"
* @return java.lang.String
*/
public static String DateToMonthAndDayStringForZhCn(Date dateStr) {
SimpleDateFormat clsFormat = new SimpleDateFormat("MM月dd日");
String returnString = new String("");
returnString = clsFormat.format(dateStr);
return returnString;
} /**
* 将传入日期转换为"yyyyMMdd"
* @return java.lang.String
*/
public static String DateToStringByName(Date dateStr) {
SimpleDateFormat clsFormat = new SimpleDateFormat("yyyyMMdd");
String returnString = new String("");
returnString = clsFormat.format(dateStr);
return returnString;
} /**
* 将传入String("yyyy-MM-dd")转换为java.util.Date
* @throws ParseException
* @return java.util.Date
*/
public static Date stringToDate(String str) throws ParseException {
Date date = new Date();
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
date = formater.parse(str);
return date;
} /**
* 将传入String("yyyy-MM-dd HH:mm:ss")转换为java.util.Date
* @throws ParseException
* @return java.util.Date
*/
public static Date stringToDatetime(String str) throws ParseException {
Date date = new Date();
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
date = formater.parse(str);
return date;
} /**
* 将传入String("EEE MMM dd HH:mm:ss z yyyy", Locale.US)转换为java.util.Date <br />
* 主要用于Excel导入时日期格式的转化
* @throws ParseException
* @return java.util.Date
*/
public static Date stringToDateForUS(String str) throws ParseException {
Date date = new Date();
SimpleDateFormat formater = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.US);
date = formater.parse(str);
return date;
} /**
* 当前日期+days天 <br />
* @return java.util.Date
*/
public static Date getDateByAfter(int days) {
Calendar cal = Calendar.getInstance();
// int day=cal.get(Calendar.DATE);
cal.add(Calendar.DAY_OF_YEAR, days);
return cal.getTime();
} /**
* 获取时间戳,格式:"yyyyMMddHHmmssSSS" <br />
* @return java.lang.String
*/
public static String getCurrTimestampForString() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmssSSS");
Date currentTime = new Date();
String dateString = formatter.format(currentTime);
return dateString;
} /**
* 获取时间戳,格式:"yyyyMMddddhhmmssSSS" <br />
* @return java.lang.Integer
*/
public static Integer getCurrTimestampForInteger() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddddhhmmssSSS");
Date currentTime = new Date();
String dateString = formatter.format(currentTime);
Integer res=Integer.parseInt(dateString);
return res;
} /**
* 当前时期+month月 <br />
* @return java.util.Date
*/
public static Date datePlusMonth(int month) {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, month);
return cal.getTime();
}
/**
* 返回时间
* @param str
* @return
* @throws ParseException
*/
public static String stringToTime(String str){
try {
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = formater.parse(str);
SimpleDateFormat fmt = new SimpleDateFormat("HH:mm:ss");
String dateString = fmt.format(date);
return dateString;
} catch (ParseException e) {
e.printStackTrace();
return null;
}
} /**
* 返回日期
* @param str
* @return
* @throws ParseException
*/
public static String stringToDateString(String str){
try {
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = formater.parse(str);
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
String dateString = fmt.format(date);
return dateString;
} catch (ParseException e) {
e.printStackTrace();
return null;
}
} /**
* 返回日期 时分
* @param str
* @return
* @throws ParseException
*/
public static String stringToDateAndHourAndMinString(String str){
try {
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = formater.parse(str);
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String dateString = fmt.format(date);
return dateString;
} catch (ParseException e) {
e.printStackTrace();
return null;
}
} /**
* 返回日期及星期
* @param str
* @return
* @throws ParseException
*/
public static String stringToDateAndWeek(String str){
try {
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = formater.parse(str);
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd / E");
String dateString = fmt.format(date);
return dateString;
} catch (ParseException e) {
e.printStackTrace();
return null;
}
} /**
* 将秒转换为时分秒格式
* @param second
* @return
*/
public static String secondToDateTimeForMp3(int second){
String result="";
GregorianCalendar gc = new GregorianCalendar();
gc.setTimeInMillis(second * 1000);
if(second<3600){
SimpleDateFormat format = new SimpleDateFormat("mm:ss");
result=format.format(gc.getTime());
}else{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
result=format.format(gc.getTime());
}
return result;
} /**
* 返回MM.dd
* @param str
* @return
* @throws ParseException
*/
public static String stringToMonthAndDay(String str){
try {
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
Date date = formater.parse(str);
SimpleDateFormat fmt = new SimpleDateFormat("MM.dd");
String dateString = fmt.format(date);
return dateString;
} catch (ParseException e) {
e.printStackTrace();
return null;
}
} /**
* 返回MM月dd日
* @param str
* @return
* @throws ParseException
*/
public static String stringToFormatMonthAndDay(String str){
try {
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
Date date = formater.parse(str);
SimpleDateFormat fmt = new SimpleDateFormat("MM月dd日");
String dateString = fmt.format(date);
return dateString;
} catch (ParseException e) {
e.printStackTrace();
return null;
}
} /**
* 返回yyyy.MM.dd
* @param str
* @return
* @throws ParseException
*/
public static String stringToFormatYearAndMonthAndDay(String str){
try {
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
Date date = formater.parse(str);
SimpleDateFormat fmt = new SimpleDateFormat("yyyy.MM.dd");
String dateString = fmt.format(date);
return dateString;
} catch (ParseException e) {
e.printStackTrace();
return null;
}
} /**
* 返回日期是第几天
* @param str
* @return
* @throws ParseException
*/
public static Integer stringToDay(String str) {
try {
Date date = new Date();
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
date = formater.parse(str);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar.get(Calendar.DAY_OF_MONTH);
} catch (ParseException e) {
e.printStackTrace();
return -1;
}
} /**
* 返回星期几 <br/>
* 星期一 1 ~ 星期六 6 <br/>
* 星期日 0
* @param str
* @return
* @throws ParseException
*/
public static Integer stringToWeekNum(String str) {
try {
Date date = new Date();
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
date = formater.parse(str);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar.get(Calendar.DAY_OF_WEEK)-1;
} catch (ParseException e) {
e.printStackTrace();
return -1;
}
} /**
* 获取当前年月,格式:yyyy
* @return java.lang.String
*/
public static String getYear() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy");
Date currentTime = new Date();
String date = formatter.format(currentTime);
return date;
} /**
* 返回某一段日期内的所有日期
* */
public static List<String> getAllInDateRange(String start_date, String end_date) {
if(StringUtils.isEmpty(start_date) || StringUtils.isEmpty(end_date)){
return null;
}
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
List<String> listDate = new ArrayList();
listDate.add(start_date);
try{
Calendar calBegin = Calendar.getInstance();
calBegin.setTime(formatter.parse(start_date));
Calendar calEnd = Calendar.getInstance();
calEnd.setTime(formatter.parse(end_date));
while (formatter.parse(end_date).after(calBegin.getTime())) {
calBegin.add(Calendar.DAY_OF_MONTH, 1);
listDate.add(formatter.format(calBegin.getTime()));
}
return listDate;
} catch (ParseException e){
e.printStackTrace();;
}
return null;
}
/*
* 当前日期后n天的日期
* */
public static String afterNDay(int n){
Calendar c=Calendar.getInstance();
DateFormat df=new SimpleDateFormat("yyyy-MM-dd");
c.setTime(new Date());
c.add(Calendar.DATE,n);
Date d2=c.getTime();
String s=df.format(d2);
return s;
} public static String getDateDiff (String selfDate) { if(selfDate == null || selfDate=="") {
return "";
}else { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = dateFormat.parse(selfDate);
} catch (ParseException e) {
e.printStackTrace();
}
long diff = new Date().getTime() - date.getTime();
long day = diff/(1000*60*60*24);
long hour = (diff - day*(1000*60*60*24))/(1000*60*60);
long minutes = (diff - day*(1000*60*60*24) - hour*(1000*60*60))/(1000*60);
String timeDiff = day+"天"+hour+"小时"+minutes+"分";
return timeDiff;
} } /**
* 字符串类型的时间转换时间戳
* @param date "2018-3-19 13:09:00"
* @return 1470154736000
*/
public static long getTimeLong (String date) {
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
Date d;
long time = 0;
try {
d = sdf.parse(date);
time = d.getTime();
//System.out.println(d + ": " + time);
} catch (ParseException e) {
e.printStackTrace();
}
return time;
} /**
* 获取星期
* @param weekday
* @return
*/
public static String getStringWeekday(int weekday){ if(weekday == 1){
return "周日";
} else if(weekday == 2){
return "周一";
} else if(weekday == 3){
return "周二";
} else if(weekday == 4){
return "周三";
} else if(weekday == 5){
return "周四";
} else if(weekday == 6){
return "周五";
} else if(weekday == 7){
return "周六";
}
return "";
} /**
* 计算两个时间 间隔了多少天
* @param beforeTime
* @param afterTime
* @return
*/
public static int getIntervalDay(long beforeTime, long afterTime){
Calendar calendar1=Calendar.getInstance();
calendar1.setTimeInMillis(beforeTime);
calendar1.set(Calendar.MILLISECOND,0);
calendar1.set(Calendar.SECOND,0);
calendar1.set(Calendar.MINUTE,0);
calendar1.set(Calendar.HOUR,0); Calendar calendar2=Calendar.getInstance();
calendar2.setTimeInMillis(afterTime);
calendar2.set(Calendar.MILLISECOND,0);
calendar2.set(Calendar.SECOND,0);
calendar2.set(Calendar.MINUTE,0);
calendar2.set(Calendar.HOUR,0); return (int)((calendar2.getTimeInMillis()-calendar1.getTimeInMillis())/ONEDAY_TIME); } /**
* 当月1日0点
* @param
* @param
* @return
*/
public static long getCurrentMonthStartTime(){
Calendar calendar=Calendar.getInstance(); calendar.set(Calendar.MILLISECOND,0);
calendar.set(Calendar.SECOND,0);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.set(Calendar.DAY_OF_MONTH,1); return calendar.getTimeInMillis(); } /**
* 指定月份 最后一天 0点时刻;
* @return
*/
public static long getMonthLastDayZeroTime(String month){ try {
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM");
Date date= simpleDateFormat.parse(month);
Calendar calendar= Calendar.getInstance();
calendar.setTimeInMillis(date.getTime());
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
calendar.add(Calendar.MONTH,1);
calendar.add(Calendar.DAY_OF_MONTH,-1); return calendar.getTimeInMillis();
}catch (Exception e){
throw new RuntimeException(e); } } /**
* 获取第二天0点时刻
* @param day
* @return
*/
public static long getNextDayZeroTime(String day){
try {
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
Date date= simpleDateFormat.parse(day);
Calendar calendar= Calendar.getInstance();
calendar.setTimeInMillis(date.getTime()); calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0); calendar.add(Calendar.DAY_OF_MONTH,1);
return calendar.getTimeInMillis();
}catch (Exception e){
throw new RuntimeException(e);
}
} /**
*
* @param day
* @return
*/
public static long getDayZeroTime(String day){
try {
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
Date date= simpleDateFormat.parse(day);
Calendar calendar= Calendar.getInstance();
calendar.setTimeInMillis(date.getTime()); calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
return calendar.getTimeInMillis();
}catch (Exception e){
throw new RuntimeException(e);
}
} /**
*
* 获取下一个月的第一天.
*
* @return
*/
public static String getPerFirstDayOfMonth() {
SimpleDateFormat dft = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, 1);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
return dft.format(calendar.getTime());
} /**
* 今天的路径
* @return
*/
public static String addressRadom()
{
Date date = new Date();
String uploadMM = DateUtil.timeToString(date, "yyyy/MM");
String uploadDD = DateUtil.timeToString(date, "dd");
String uploadDir = uploadMM + "/" + uploadDD + "/"; return uploadDir;
} /**
* 补0
* @param zero
* @param nikeo
* @return
*/
public static String haoAddOne(String zero,String nikeo)
{
Integer n = Integer.parseInt(nikeo);
DecimalFormat df = new DecimalFormat(zero);
return df.format(n);
}

日期(date)运用座谈会的更多相关文章

  1. 谈谈javascript中的日期Date对象

    一.日期对象  在javascript中并没有日期型的数据类型,但是提供了一个日期对象可以操作日期和时间.  日期对象的创建:  new Date();二.将日期对象转换为字符串  将日期对象转换为字 ...

  2. XStream、JAXB 日期(Date)、数字(Number)格式化输出xml

    XStream.Jaxb是java中用于对象xml序列化/反序列化 的经典开源项目,利用它们将对象转换成xml时,经常会遇到日期(Date).数字按指定格式输出的需求,下面是使用示例: 一.日期字段格 ...

  3. JSONArray.fromObject()注入处理日期Date格式

    package jsonDateProcess; import java.sql.Date; import java.text.SimpleDateFormat; import java.util.L ...

  4. 格式化angularjs日期'/Date(-62135596800000)/'

    在实现在angularjs时,发现经序列化后的日期需要格式化显示. 翻看以前的博客,似乎有写过一篇有关js方面的解决办法<格式化json日期'/Date(-62135596800000)/'&g ...

  5. java 日期Date类型比较大小

      java 日期Date类型比较大小 CreateTime--2018年5月31日16点39分 Author:Marydon import java.text.DateFormat; import ...

  6. linux 改动时间和日期date

    查看日期和时间 date 改动日期 date -s 月/日/年 date -s 08/15/2015 改动时间 date -s 09:29:33 写入CMOS sudo clock -w 利用ssh同 ...

  7. 日期Date和String/Long之间的转换

    下面是关于日期的常见的几种类型转换: import java.text.ParseException; import java.text.SimpleDateFormat; import java.u ...

  8. JavaScript---正则使用,日期Date的使用,Math的使用,JS面向对象(工厂模式,元模型创建对象,Object添加方法)

    JavaScript---正则使用,日期Date的使用,Math的使用,JS面向对象(工厂模式,元模型创建对象,Object添加方法) 一丶正则的用法 创建正则对象: 方式一: var reg=new ...

  9. JavaScript---js语法,数据类型及方法, 数组及方法,JSON对象及方法,日期Date及方法,正则及方法,数据类型转换,运算符, 控制流程(三元运算),函数(匿名函数,自调用函数)

    day46 一丶javascript介绍 JavaScript的基础分为三个       1.ECMAScript:JavaScript的语法标准.包括变量,表达式,运算符,函数,if语句,for语句 ...

  10. javascript类型系统——日期Date对象

    × 目录 [1]静态方法 [2]构造函数 [3]实例方法 前面的话 Date对象是javascript语言中内置的数据类型,用于提供日期和时间的操作接口.Date对象是在早期java中的java.ut ...

随机推荐

  1. android AsyncTask介绍 AsyncTask和Handler对比

    1 ) AsyncTask实现的原理,和适用的优缺点 AsyncTask,是android提供的轻量级的异步类,可以直接继承AsyncTask,在类中实现异步操作,并提供接口反馈当前异步执行的程度(可 ...

  2. 多条select语句的合并

    select (') , (') , (select max(ssq) from DW_MARK_FXJS.F_GS_YCXJJDCSY@new_zgxt ) from dual 这样就不用傻傻的执行 ...

  3. Sandglass

    题目描述 We have a sandglass consisting of two bulbs, bulb A and bulb B. These bulbs contain some amount ...

  4. 上下文管理器 contextlib

    from contextlib import contextmanager @contextmanager def tag(name): print "<%s>" % ...

  5. elk相关

    curl http://localhost:9200/_aliases?pretty=1 #列出elk中所有索引

  6. 【BZOJ4491】我也不知道题目名字是什么 [线段树]

    我也不知道题目名字是什么 Time Limit: 10 Sec  Memory Limit: 512 MB[Submit][Status][Discuss] Description 给定一个序列A[i ...

  7. 密码本(无bug版)

    main.cpp #include <stdio.h> #include <stdlib.h> #include "data.h" #include &qu ...

  8. setTimeout()和setInterval()方法的区别

    setTimeout(); //5秒后执行yourFunction(),只执行一次 setInterval(); //每隔5秒执行一次 1.setTimeout(funhander,time)的作用是 ...

  9. gcc中的内嵌汇编语言(Intel i386平台)

    [转]http://bbs.chinaunix.net/thread-2149855-1-1.html 一.声明  虽然Linux的核心代码大部分是用C语言编写的,但是不可避免的其中还是有一部分是用汇 ...

  10. Development tools[重点]

    Development tools yum groupinfo "Development tools" Loaded plugins: product-id, security, ...