Class JDateFormat

java.lang.Object
io.odysz.semantic.util.JDateFormat

public class JDateFormat extends Object
Date formatting and parsing helper.
This is basically used for datatime used in Json / Gson.

For date format reference, see Class SimpleDateFormat API at Oracle
For additional information of Json datetime format: IBM Learn


For sql format helper, see DateFormat.
Author:
ody
  • Constructor Details

  • Method Details

    • JdateZh

      public static JDateFormat JdateZh()
      yyyy年MM月dd日
    • Jdate

      public static JDateFormat Jdate()
      yyyy-MM-dd
    • iso8601Zh

      public static JDateFormat iso8601Zh()
      yyyy年MM月dd日'T'HH:mm:ss.SSSZ, e.g. 2001年07月04日T12:08:56.235-0700
    • iso8601

      public static JDateFormat iso8601()
      yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. 2001-07-04T12:08:56.235-0700
    • simpleLong

      public static JDateFormat simpleLong()
      yyyy-MM-dd HH:mm:ss, e.g. 2001-07-04 12:08:56.235
    • format

      public String format(Date d)
      yyyy-MM-dd
      Parameters:
      d -
      Returns:
      mysdf.format(d)
    • parse

      public Date parse(String text) throws ParseException
      Throws:
      ParseException
    • incSeconds

      public String incSeconds(io.odysz.common.dbtype drvType, String date0, int snds) throws ParseException
      Throws:
      ParseException
    • getDayDiff

      public static String getDayDiff(Date date2, Date date1)
    • getDayDiffInt

      public static long getDayDiffInt(Date d2, Date d1)