Vitamin D needs ultraviolet on bare skin — and the same ultraviolet damages the DNA in that skin. There is no dose that gives one without the other. A pill gives you the identical molecule and skips all of it.
Your body clock needs bright light in your eyes. That's ordinary visible light, not ultraviolet, and no pill replaces it. It sets your sleep and much of your mood — and an overcast morning outdoors is still around ten times brighter than a lit room.
The sun's position is exact. Today's sky, temperature, altitude and ozone are real data for your coordinates. Everything between — ultraviolet through air, vitamin D in skin — is a model good to about a factor of two. Trust the shape and the timing, not the exact minute.
Sources: Engelsen, Brustad, Aksnes & Lund, Daily duration of vitamin D synthesis in human skin, Photochemistry and Photobiology 81 (2005) 1287. Webb, Who, what, where and when, Progress in Biophysics and Molecular Biology 92 (2006) 17. Shih, Farrar, Cooke et al., Fractional sunburn threshold UVR doses generate equivalent vitamin D and DNA damage in skin types I–VI, Journal of Investigative Dermatology 138 (2018) 2244. Manson et al. (VITAL), New England Journal of Medicine 380 (2019) 33. EFSA, tolerable upper intake level for vitamin D, EFSA Journal (2023) 8145. Van Heuklon, Estimating atmospheric ozone for solar radiation models, Solar Energy 22 (1979) 63. Livsmedelsverket's recommendations and LIVSFS 2018:5. On daylight and the body clock: the retinal cells that set it respond to bright visible light, not ultraviolet — see Lucas et al., Measuring and using light in the melanopsin age, Trends in Neurosciences 37 (2014) 1. Weather, ultraviolet and temperature data from Open-Meteo, CC BY 4.0.
Not medical advice
A physics calculator, not a prescription. The only way to know your own level is a blood test. High doses, pregnancy, or kidney or parathyroid trouble are a conversation with a doctor.