使用LocalDateTime和Date的区别-创新互联

使用LocalDateTime和Date的区别?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

创新互联建站主要从事网页设计、PC网站建设(电脑版网站建设)、wap网站建设(手机版网站建设)、响应式网站设计、程序开发、网站优化、微网站、小程序设计等,凭借多年来在互联网的打拼,我们在互联网网站建设行业积累了丰富的成都网站建设、成都网站制作、网站设计、网络营销经验,集策划、开发、设计、营销、管理等多方位专业化运作于一体。

SimpleDateFormat的format方法最终调用代码:

private StringBuffer format(Date date, StringBuffer toAppendTo,
               FieldDelegate delegate) {
    // Convert input date to time field list
    calendar.setTime(date);

    boolean useDateFormatSymbols = useDateFormatSymbols();

    for (int i = 0; i < compiledPattern.length; ) {
      int tag = compiledPattern[i] >>> 8;
      int count = compiledPattern[i++] & 0xff;
      if (count == 255) {
        count = compiledPattern[i++] << 16;
        count |= compiledPattern[i++];
      }

      switch (tag) {
      case TAG_QUOTE_ASCII_CHAR:
        toAppendTo.append((char)count);
        break;

      case TAG_QUOTE_CHARS:
        toAppendTo.append(compiledPattern, i, count);
        i += count;
        break;

      default:
        subFormat(tag, count, delegate, toAppendTo, useDateFormatSymbols);
        break;
      }
    }
    return toAppendTo;
  }

网站名称:使用LocalDateTime和Date的区别-创新互联
本文路径:http://pwwzsj.com/article/djpidj.html