Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2016
    Location
    Malaysia
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation How to know the range of week compare to current week ?

    I wonder how to know whether the date is few weeks ago?

    Assume I have this date and time 2019-05-24 17:25. How can I know this date is last week ago compare with current date?

    I want to know two weeks ago, one weeks ago and less than one week.

    Thanks.

  2. #2
    New Coder
    Join Date
    Jan 2016
    Location
    Malaysia
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have solved by using this
    Code:
    long noOfDaysBetween = ChronoUnit.WEEKS.between(dateBefore, dateAfter);


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •