-2

I'm stuck between java.time.temporal.ChronoUnit and java.time.temporal.Temporal until. How do they work??

6
  • 1
    What are you stuck with? Did you check the documentation? Commented Aug 8, 2020 at 16:23
  • @ArvindKumarAvinash I think you accidentially closed the question as the wrong duplicate. Commented Aug 8, 2020 at 16:27
  • @dan1st - When I closed it, your answer had not been posted (check the closing time). Interestingly, you were able to post the answer probably because you might have drafted your answer. Generally, I try to avoid closing a question if someone has already answered. My opinion for this question is that it's not only duplicate, but OP also has not put any effort. Even if I vote to open it, it will be closed by someone for lack of focus/effort. What do you say? Commented Aug 8, 2020 at 16:40
  • I wrote my answer on the SE mobile app and it is possible, there if you start writing the answer before the closure. I personally think that this is not a bad question itself as ChronoUnit and TemporalUnit seem fairly similar, even if I completely agree that there seems not to be much effort put into this question. Commented Aug 8, 2020 at 16:44
  • Welcome to Stack Overflow. Your title and your question body seem to be asking two very different questions. You probably meant the same question, so could you please explain how the two are related? Also report what your search turned up and what more precisely you are still missing after that or how the results were confusing or not helpful. Commented Aug 8, 2020 at 19:05

1 Answer 1

2

Look at the javadoc for ChronoUnit and TemporalUntit.

The ChronoUnit enum basically provides some standard TemporalUnits but other developers could implement other TemporalUnits.

For example, you can write the following code:

TemporalUnit u=ChronoUnit.DAYS; 

but you can also create new TemporalUnits by extending ChronoUnit.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.