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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -