1

Is there any single line java command using joda to get seconds in a year?

I tried various combinations but not seems to be working.

What I tried is

    System.out.println("Seconds in a day: " + Days.ONE.toStandardSeconds().getSeconds());
Sotirios Delimanolis
  • 263,859
  • 56
  • 671
  • 702
shaILU
  • 1,962
  • 2
  • 19
  • 40

1 Answers1

4

I was looking on stackoverflow and come across this How can I get the number of days in a year using JodaTime?

got the idea

new DateTime().year().toInterval().toDuration().getStandardSeconds()

and it works for me.

Community
  • 1
  • 1
shaILU
  • 1,962
  • 2
  • 19
  • 40