Datapack that changes weather depending on the time

Hello, I want to make a datapack that sets the weather to rainy during the day, and to thunder during the night (so it's always raining, there's also a thunder at night, and it's never clear). Unfortunately I don't have much experience with data packs and it just doesn't work for me. My Minecraft version is 1.20. Can someone tell me how the code should look like? Any help will be appreciated :)
Continue to help post