Converting DateTime to HOY sdk

Hi
I’m trying to convert a datetime to HOY, and i’m looking through the core code but I got stuck at:

return self.timetuple().tm_yday
from
https://www.ladybug.tools/ladybug/docs/_modules/ladybug/dt.html#DateTime

Is there a way to see the source code fully so that I can go from datetime to HOY in one fluent code? I’m trying to run this in Python in an external program so I just want to code behind.

Thanks

Hello, if these are not the droids you are looking for: hopefully they are in the ballpark.

image

-trevor

Hi,

Thanks, but you kind of linked the same link that I posted in the question…

What is missing from those code samples is the function .tm_yday

tm_yday comes from the ironpython library:
https://ironpython-test.readthedocs.io/en/latest/library/time.html#time.struct_time

1 Like

Hi, thanks!
In the end I solved it similarly with converting the DateTime object directly:

hoy = round(hoy + (i.minute/10) * .166667,5)

where ‘i’ is the DateTime.