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
  • 274,122
  • 60
  • 696
  • 724
shaILU
  • 2,050
  • 3
  • 21
  • 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
  • 2,050
  • 3
  • 21
  • 40