zoukankan      html  css  js  c++  java
  • Calendar与Date之间的转换

    (1) Calendar----> Date

      Date getTime();     //Calendar提供了方法getTime(),该方法返回一个Date对象,该对象表示的时间就是当前Calendar表示的时间。

        举例:Calendar c=new Calendar();

                     Date date=c.getTime();

    (2) Date----> Calendar

      void setTime(Date date);    //Calendar的setTime方法可以使当前Calendar表示给定的Date所表示的时间。

      举例:Calendar c=new Calendar();

         Date date=new Date();

         c.setTime(date);

  • 相关阅读:
    oracle学习6
    oracle学习5
    oracle学习4
    oracle学习3
    oracle的过滤与排序
    poj1064 Cable master
    poj3169 Layout
    UVA
    poj2341 Expedition
    poj3617 Best Cow Line
  • 原文地址:https://www.cnblogs.com/nancyzhang/p/8490325.html
Copyright © 2011-2022 走看看