-1

我的 android 应用程序需要显示必须根据逻辑检查增加的时间

我的条件示例如下

    d = (String) DateFormat.format("yyyy-MM-dd,hh:mm:ss", new java.util.Date());
if(condition)
    {
     //i want to increment the time for about an hour and display
    }
    else
     {
      // increment the date to 1 and display
     }

我不关心条件,而是关心时间和日期递增的代码

现在如何编码以相应地增加上述时间格式

4

1 回答 1

0

嗯。
改为使用Calendar
如果您查看文档,您应该能够弄清楚如何做您想做的事情。

如果您无法从文档中弄清楚(经过诚实的努力),那么我很乐意详细说明该过程。

于 2012-03-24T09:53:58.877 回答