Daily Challenge #53

This is my first contribution to the #daily-challenge category.
Your task is to create a simple app that shows how many months, weeks and days are you in the current year.

Result for 18/4/2020 => 3 months, 2 weeks, 4 days

Of course, you can use the device time.


  • You can’t use an online API

Have fun




There can be multiple solutions and it is one of them:


1 Like

What date are you using? Today’s? If so, the result should be

3 months, 2 weeks, 4 days

I think you too are confused.

If this is result then today’s date will be:
Today’s date: 2*7+6 = 14+6 = 20
but today is 18.
So 2 weeks , 4 days is the correct answer.

And for this:

Clock counts current month also so we have to subtract 1 to get correct result.

Ah, true.

Well, not in every case. If the day is the last day of the month, we set the day to 0 and set the month to the current month. I edited my topic.

1 Like

Wait for more answers man…

:+1:‏‏‎ ‎‏‏‎ ‎

Nice job, I will import the blocks and test it.

I built this logic but I can’t test using a mobile phone. because I don’t have any smartphone phone.

Just a small correction. According to wikipedia, a leap year is if ((year%4==0 || year%400==0) && year%100!=0), meaning that for year 2100 your program would return True, even tho it should be False

1 Like

Thank you so much for your info. this is very helpful for me. is other blocks are correct ?

Haven’t tested it yet.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.