question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a Converter<TimeUnit, ChronoUnit>

See original GitHub issue

currently there’s no official way (in JDK 8) for converting between java.util.concurrent.TimeUnit and ChronoUnit (there will be in JDK 9, though).

So we should consider providing one. Maybe it’s time to start selectively open sourcing our com.google.common.time package?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
kluevercommented, Sep 19, 2016

We just made the transition to Java 8 internally last week, and we plan on releasing a Guava 21 (with Java8 support) sometime next quarter.

1reaction
kluevercommented, Mar 28, 2017

The reason we’ve been on the fence about adding this is that it already exists in threeten-extra as:

And we’re hesitant to add competing solutions when a reasonable solution already exists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Converting TimeUnit to ChronoUnit? - java - Stack Overflow
Java 9. In Java 9 the TimeUnit API got extended and allows to convert between TimeUnit and ChronoUnit : TimeUnit.toChronoUnit() // returns a...
Read more >
ChronoUnit (Java Platform SE 8 ) - Oracle Help Center
This set of units provide unit-based access to manipulate a date, time or date-time. The standard set of units can be extended by...
Read more >
What is TimeUnit.toChronoUnit() in Java? - Educative.io
A ChronoUnit is an enum that represents a standard set of date periods units. This set of units provides unit-based access to manipulate...
Read more >
Java Data Type How to - Convert java.util.concurrent.TimeUnit ...
Java Data Type How to - Convert java.util.concurrent.TimeUnit to java.time.temporal.ChronoUnit and back.
Read more >
Convert time unit to duration in Java - Codeleak.pl
TimeUnit represents time durations in Java at a given unit of granularity and provides utility methods to convert across units.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found