Calculation on Dates

Hi everyone,
can we run calculation on dates? I’m converting to Julian Day to be able to do some basic math on 2 dates but i was wondering if there’s a better way to do it?

Thanks for any help

what kind of calculation on dates ?

1 Like

Pretty much what you are showing me lol
Date A - Date B

image

I’m tempted to start… laughing ahahahah
Thanks a lot

1 Like

Even easier: Look into the nodes in the Input section of your library, under “DateTime” and “TimeSpan” as there is a TimeSpan.ByDateDifference there.

Specifically this may be of interest:

2 Likes

Can’t believe i missed this… thanks for the heads up

that makes two of us

It’s easy to overlook stuff - I do it at least once a week and then go ‘oh yeah that node… well next time.’ :slight_smile:

i know this is an old post, but you have worked with times.

I found the timespan nodes…

but what i want is to calculate with dates so i have today 7-6-2022 and i want to add or subtrackted 2 days…

i want to read a file with a date entry then see what date it is now… and then get a list of all the working days (so no weekends)

for example the file read is from 1-6-2022… today is 7-6-2022
i want a list
2-6-2022
3-6-2022
6-6-2022

is fine if the weekends are in for now… i will filter that out with the weekdays node

Here is a quik way to get the total of days

that is not what i mean…
the input is 1-6 and the date today 7-6…

the output needs to be
2-6-2022
3-6-2022
4-6-2022
5-6-2022
6-6-2022
7-6-2022

The date format is based on your computer settings.
If you need to return it as a string then you can extract each component and reassemble them in the order you want

Without python to get the total without work days

Date Time.dyn (35.5 KB)

1 Like

but time span gives the number of days between two dates…

i need the dates it self

the input is 1-6 and the date today 7-6…

the output needs to be
2-6-2022
3-6-2022
4-6-2022
5-6-2022
6-6-2022
7-6-2022

You also have that but your initial question was :
“but what i want is to calculate with dates so i have today 7-6-2022 and i want to add or subtrackted 2 days…”

sorry my question wasn’t clear…

No worries :slight_smile:
You have the date here if you add this node:

1 Like

thanks got it