Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by gruez on Saturday January 04, 2025 @12:26PM
(#42596136)
To be fair most time libraries suck and can't handle fairly basic operations. For instance, if you're using python's datetime module and want to get the start/end dates of the current month, you need to "roll your own" like
[ Parent
| on HN ]
Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by brianwawok on Saturday January 04, 2025 @12:31PM
(#42596172)
So in Dec your code hits month 13? Kinda funny in a post how rolling your own time library is easy we made trivial bugs
Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by gruez on Saturday January 04, 2025 @12:37PM
(#42596244)
That's the point. I'm not advocating rolling your own date logic, only pointing out how easy it is to for "roll your own" logic to make its way into code even if if you're using a datetime library.
Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by ainiriand on Saturday January 04, 2025 @05:54PM
(#42598284)
Your solution is faulty.
Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by compootr on Saturday January 04, 2025 @06:58PM
(#42598593)
aren't months zero-indexed?
Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by MadnessASAP on Saturday January 04, 2025 @03:27PM
(#42597450)
If you're going to copy my code onto HN I would appreciate attribution.
/s
Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by ainiriand on Saturday January 04, 2025 @05:52PM
(#42598271)
You probably haven`t used phps Carbon.
Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by Caligatio on Sunday January 05, 2025 @12:01AM
(#42599898)
You should use:
calendar.monthrange
Re:Rival to SpaceX's Starlink Goes Dark After Failing to Acc...
by orf on Sunday January 05, 2025 @11:14AM
(#42602738)
First result on google for “python's datetime module and want to get the start/end dates of the current month” shows a simple solution:
https://stackoverflow.com/questions/42950/get-the-last-day-o...