Extracting values from timex library in elixir

Hello everyone, I hope you are doing well. I am currently trying to build a clock feature and i’m using Timex for elixir.

Timex.local()

it returns:

#DateTime<2024-06-22 15:02:01.862841+03:00 EAT Africa/Nairobi>

“”"

How can I extract the given values e.g time and date separately so that I can send them As assigns
Thank you in advance.

Check out DateTime.to_date/1 and DateTime.to_time/1.

1 Like

thanks