How can I compare to minutes to something like local time

I have one more question
Can we convert local DateTime to integer also?
DateTime.utc_now() = ~U[2021-09-16 13:31:56.389124Z]
something like in minutes? or second?

Yes, we can subtract the reference from it with DateTime.diff. But why? In my experience, it’s much less error prone to work with proper date(time) types than integers.

Yes but how? In this case, you need two DateTime, right?

I’m trying to test with both. In any case I will learn something when I will write few test cases.

I think it might be time for you to do some research on your own. I’ve provided enough info in the snippets above.

1 Like

Sure thanks