You can only select weather in GTA Online through some jobs (some jobs have a pre-scripted weather) and through custom jobs created in the Content Creator.
In GTA Online free mode, you can't select or change the weather, unless you use mods. Free mode weather is set server-side and can't be changed unless you use mods or other exploits which could cause your account to be suspended or banned.
Any attempt to tamper with the behavior of GTA Online by installing or
executing mods, scripts, or other exploits, modifying the game files
or manipulating the game in any way while it is executing will result
in disciplinary action including but not limited to time in the
cheater pool, bans and potential suspension of your account
- Rockstar Games Support article, "Update on GTA Online Cheaters and Modded GTA$"