java - Obtaining the number of standard seconds in a minute with JodaTime -
i need obtain integer, long or double represents number of standard seconds contained in given number of standard minutes.
1 minute => 60 seconds 2 minutes => 120 seconds ..
what preferred way of obtaining number of standard seconds within minute using jodatime?
so far, i've been using this:
minutes.minutes(2).tostandardseconds().getseconds()
i find ".getseconds()" redundant.
in c#, have used
timespan.fromminutes(2).totalseconds
is there similar in jodatime?
you can use datetimeconstants
. specifically, can use datetimeconstants.seconds_per_minute
import org.joda.time.datetimeconstants; system.out.println(datetimeconstants.seconds_per_minute);
read more available constants here..
Comments
Post a Comment