Getting 365 days from Time Struct

Hi ! Here is my question: I’m trying to make a rotating arrow for a round calendar to show what day it is.It is linked to the windows time but the problem is that it only makes 30/31 ticks (days in one month) and then it goes from the start. I need to make it somehow 365 ticks instead of 30 and still be linked to the windows time. Here is screenshot from the class blueprint

Negative delay? I guess it must happen in the future?..

Do you have 31 days on the display?

No, just imagine a circle with all 365 days (starting from 1 to 365) and it must tick correctly in every sector. I’m using a cylinder model from blender with 365 sides.

You’ve got the angle in the delay node. That’s how many degrees you need to move. How often you do that is up to you.

Changing the number in the delay node does nothing. When I manually change the day from windows the arrow ticks correctly, the problem is that it ticks only 30 or 31 times (depends on the current month) and when the next month comes the arrow resets from the start because it sees that its day 1. I need to make it tick 365 and it needs to happen when the day has been changed (example: it will tick correctly from 1st till 31th July, but on August 1st it will reset from start)

Use the Months value - “simple” math here

We have 12 months, the February counts 28 days
Month 7 and 8 are both 31 days which leaves us 4 months with 30 days

Soo we need a set of rules for those months as unfortunately we cannot count them all as 31 days months :wink:

You can use a “for loop”

First index = 1, Last index = (actual month - 1)

The -1 is there because you don’t wanna add ALL days if this is the month we live at, instead we’ll add the days that passed already within the month

Branch:
IF index = 2 add 28 to the days counter (we do it at the very beginning to exclude the lonely 28-days February)

Else(FALSE) (it’s any other month):

Next branch:
IF Month <=7 AND IF A(month) modulo% B(2) = 0 it’s an EVEN number (until June those months excluding Feb have 30 days)
= add 30 days

Else: IF month >7 AND IF A(month) Modulo% B = 0 add 31 days (from this month this swaps places and EVEN numbered months are 30days)

Almost ready, we need to place something more on the very beginning - check if the actual month is the one we are living in and if yes - add days value

One last branch at the beginning (before the first branch described above)
IF index = Month - add days instead

That branch isn’t so necessary actually (because we excluded it in the loop by adding -1, leaving without the subtraction needs the branch last branch above)

index = index from the Loop
Modulo = remainder of a fraction

It may be a bit rough, I type this on my phone from my head but I hope you’ll get it :slight_smile:

And just btw - please change the title as this topic has nothing to do with moving an arrow but rather getting 365 days from your Time Struct

Changing the delay does nothing, because the day in windows has not changed.

There’s no point in having a delay anyway, if you’re reading the day from windows.

Try this

image

Wow, I’ve written a nice piece and it seems there a tiny node for that hahah

Nice :fire:

Always look for the node… :smiling_face:

I can’t believe that the solution was that simple xD I thought that GetDayOfYear node and the “Day” from Break Date Time were the same thing… Thanks for the help guys, it was at least 2 days struggle until that point !

Unfortunately for now I have only my lil phone so I couldn’t check

And although it exists - it’s good to practice some math for more advanced stuff later on :grin: I won’t tell anything about my branches idea as the nesting wasn’t the best :rofl:

Anyway, hope he will move forward!