类 LongDateHelper

java.lang.Object
com.walker.infrastructure.utils.LongDateHelper

public class LongDateHelper extends Object
类名称:LongDateHelper 类描述:long类型的日期的处理帮助类 功能表述:实现long类型的日期的几种辅助处理 1、得到给定日期的当月或者下一月的第一天。 2、得到给定日期的当月或者下一月的第最后一天。 3、得到给定日期的毫秒数。 4、设置给定日期的天。 编写人:李彬 编写日期:2003年08月21日
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static long
    addSeconds(long old, long seconds)
    功能: 在yyyyMMddhhmmss格式的long型日期上 加上数秒后得到新的时间
    static long
    getAfterLongTime(long oldTime, int dayNum)
    说明:返回指定时间之后的时间,可正可负,例如:给定20071201000000,减10天,得到新的日期 作者:时克英 时间:12 7, 2007
    static long
    getDaysBetween(long begin, long end)
    方法名称:getDadsBetween 功能描述:获取两个long型日期之间的天数 参数说明: begin:开始时间,时间格式应符合LongCalendar 即20040103或20040103125959 end: 结束时间 格式同begin 编写人:陈建新
    static Date
     
    static String
    返回当月第一天日期字符串,如:2014-03-01
    static long
     
    static long
    返回当月最后一天 时克英
    static long
     
    static long
    getMonthFirstDay(long longDate, int flag)
    名称:getMonthFirstDay 功能:得到给定日期的当月或下一个月的第一天。
    static long
    getMonthLastDay(long longDate, int flag)
    已过时。
    static long
    getTimeOfDate(long longDate)
    名称:getTimeOfDate 功能:得到指定日期的毫秒数 输入参数: long:longDate:指定的日期 返回值: long:毫秒数 编写人:李彬 编写时间:2003年08月21日
    long
    getTransDate(long date, int rate, int flag)
     
    static void
    main(String[] s)
     
    static long
    secondsBetween(long begin, long end)
    得到两个时间点之间相差的秒数
    long
    setDay(long longDate, long longDay)
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • LongDateHelper

      public LongDateHelper()
  • 方法详细资料

    • setDay

      public long setDay(long longDate, long longDay)
      参数:
      longDate - 给定日期
      longDay - 给定的日
      返回:
    • getMonthFirstDay

      public static long getMonthFirstDay(long longDate, int flag)
      名称:getMonthFirstDay 功能:得到给定日期的当月或下一个月的第一天。 输入参数: long:longDate:给定的日期 int:flag:标志;1:当月;0:下一个月。 返回值: long:当月第一天的日期 编写人:李彬 编写时间:2003年08月21日
    • getLastDayOfMonth

      public static long getLastDayOfMonth()
      返回当月最后一天 时克英
      返回:
    • getFirstDayOfMonth

      public static String getFirstDayOfMonth()
      返回当月第一天日期字符串,如:2014-03-01
      返回:
    • getFirstDateOfMonth

      public static Date getFirstDateOfMonth()
    • getFirstDayOfPremonth

      public static long getFirstDayOfPremonth()
    • getLastDayOfPremonth

      public static long getLastDayOfPremonth()
    • getMonthLastDay

      @Deprecated public static long getMonthLastDay(long longDate, int flag)
      已过时。
      名称:getMonthLastDay 功能:得到给定日期的当月或下一个月的最后一天。 输入参数: long:longDate:给定的日期 int:flag:标志;1:当月;0:下一个月。 返回值: long:当月最后一天的日期 编写人:李彬 编写时间:2003年08月21日
    • getTimeOfDate

      public static long getTimeOfDate(long longDate)
      名称:getTimeOfDate 功能:得到指定日期的毫秒数 输入参数: long:longDate:指定的日期 返回值: long:毫秒数 编写人:李彬 编写时间:2003年08月21日
    • getTransDate

      public long getTransDate(long date, int rate, int flag)
    • addSeconds

      public static long addSeconds(long old, long seconds)
      功能: 在yyyyMMddhhmmss格式的long型日期上 加上数秒后得到新的时间
      参数:
      old - 原时间
      seconds - 增加的秒数
      返回:
      long 新的时间
    • secondsBetween

      public static long secondsBetween(long begin, long end) throws Exception
      得到两个时间点之间相差的秒数
      参数:
      begin - long 起始时间(14位)
      end - long 终止时间(14位)
      返回:
      long 间隔秒数
      抛出:
      Exception - 时间格式不是14位
    • getDaysBetween

      public static long getDaysBetween(long begin, long end) throws Exception
      方法名称:getDadsBetween 功能描述:获取两个long型日期之间的天数 参数说明: begin:开始时间,时间格式应符合LongCalendar 即20040103或20040103125959 end: 结束时间 格式同begin 编写人:陈建新
      抛出:
      Exception
    • getAfterLongTime

      public static long getAfterLongTime(long oldTime, int dayNum)
      说明:返回指定时间之后的时间,可正可负,例如:给定20071201000000,减10天,得到新的日期 作者:时克英 时间:12 7, 2007
    • main

      public static void main(String[] s)