How do I add time to a timestamp?

后端 未结 5 384
离开以前
离开以前 2021-01-18 06:58

I need to add 14 minutes and 59 seconds to an unknown time in an array. How do I do this? This is what I have so far:

Date duration = df.parse(\"0000-00-00 0         


        
5条回答
  •  被撕碎了的回忆
    2021-01-18 07:50

    If you just want to add times, I suggest using Joda Time.

    The class LocalTime lets you add durations like this:

    LocalTime timeSum = time.plusMinutes(14).plusSeconds(59);
    

提交回复
热议问题