this post was submitted on 08 Jan 2025
252 points (97.7% liked)

Lemmy Shitpost

27308 readers
3717 users here now

Welcome to Lemmy Shitpost. Here you can shitpost to your hearts content.

Anything and everything goes. Memes, Jokes, Vents and Banter. Though we still have to comply with lemmy.world instance rules. So behave!


Rules:

1. Be Respectful


Refrain from using harmful language pertaining to a protected characteristic: e.g. race, gender, sexuality, disability or religion.

Refrain from being argumentative when responding or commenting to posts/replies. Personal attacks are not welcome here.

...


2. No Illegal Content


Content that violates the law. Any post/comment found to be in breach of common law will be removed and given to the authorities if required.

That means:

-No promoting violence/threats against any individuals

-No CSA content or Revenge Porn

-No sharing private/personal information (Doxxing)

...


3. No Spam


Posting the same post, no matter the intent is against the rules.

-If you have posted content, please refrain from re-posting said content within this community.

-Do not spam posts with intent to harass, annoy, bully, advertise, scam or harm this community.

-No posting Scams/Advertisements/Phishing Links/IP Grabbers

-No Bots, Bots will be banned from the community.

...


4. No Porn/ExplicitContent


-Do not post explicit content. Lemmy.World is not the instance for NSFW content.

-Do not post Gore or Shock Content.

...


5. No Enciting Harassment,Brigading, Doxxing or Witch Hunts


-Do not Brigade other Communities

-No calls to action against other communities/users within Lemmy or outside of Lemmy.

-No Witch Hunts against users/communities.

-No content that harasses members within or outside of the community.

...


6. NSFW should be behind NSFW tags.


-Content that is NSFW should be behind NSFW tags.

-Content that might be distressing should be kept behind NSFW tags.

...

If you see content that is a breach of the rules, please flag and report the comment and a moderator will take action where they can.


Also check out:

Partnered Communities:

1.Memes

2.Lemmy Review

3.Mildly Infuriating

4.Lemmy Be Wholesome

5.No Stupid Questions

6.You Should Know

7.Comedy Heaven

8.Credible Defense

9.Ten Forward

10.LinuxMemes (Linux themed memes)


Reach out to

All communities included on the sidebar are to be made in compliance with the instance rules. Striker

founded 2 years ago
MODERATORS
 
top 30 comments
sorted by: hot top controversial new old
[–] RememberTheApollo_@lemmy.world 11 points 8 hours ago (1 children)

After a while there is no conversion necessary. 5 pm is 5 pm is 17:00. They are the same. UTC to local however can get fucked. Time zone variables, daylight standard/savings variables, no thanks.

[–] sxan@midwest.social 6 points 7 hours ago

Yeah, I never found adding 12 to or from a number to be particularly challenging. Still, I do wish AM/PM would go away, not to mention DST. Can't escape UTC and time zones, though, not reasonably, anyway. If for no other reason than doing the conversion makes you aware of how inconvenient your suggested meeting time is for the other party.

[–] IDKWhatUsernametoPutHereLolol@lemmy.dbzer0.com 36 points 20 hours ago (3 children)
If
"am/pm indicator" = "pm"
AND
"hour" =/= "12"
ADD "12" to "hour"

Else
Ignore the am/pm indicator, time is correct in 24 hour format.

Disclaimer: I am not a programmer, I have no idea if my "code" is written in the correct format.

[–] LwL@lemmy.world 4 points 8 hours ago (1 children)

If only this was true, but for some reason midnight is 12 am. And noon is 12 pm (I'm aware that the reason is that 12:00:00.00001 is in the second half of the day. I just think it should be called 0 pm).

[–] sxan@midwest.social 3 points 6 hours ago

Midnight is 00:00 is 12am. They accounted for 12pm, but need to subtract 12 if it's 12am.

So, you'd do away with 12 entirely and make AM/PM 0-based: 00:00am - 11:59am, and then 00:00pm - 11:59pm? Makes sense if you're a programmer, but 0 is a fairly recent invention, and most daily measuring concepts are fundamentally 1-based. Heck, we couldn't even get all programming languages to agree on 0-based array indexing (looking at you, MATLAB, and you, bash).

[–] Zagorath@aussie.zone 25 points 18 hours ago

As far as pseudocode goes, this is pretty damn good. The main thing I'd change is that things in "quotes" generally represent strings, i.e. literal text. Variable names usually don't have quotes around them. That's a universal enough trait of real programming languages that it would almost never not transfer to pseudocode. Also, numbers intended to be read as numbers don't typically have quotes.

How I would change this accordingly

If
am_pm_indicator = "pm"
AND
hour =/= 12
ADD 12 to hour

Else
Ignore the am/pm indicator, time is correct in 24 hour format. # Leaving this as-is because it's more like a comment than code anyway

[–] bandwidthcrisis@lemmy.world 14 points 20 hours ago (1 children)

What is this? Some sort of COBOL or something.

[–] IDKWhatUsernametoPutHereLolol@lemmy.dbzer0.com 12 points 20 hours ago* (last edited 20 hours ago) (4 children)

Idk its my non-programmer's impression of what code looks like, sorry if its incorrect 😅

[–] AliasVortex@lemmy.world 21 points 19 hours ago* (last edited 19 hours ago) (2 children)

We call that pseudocode and it looks fine to me. No computer will run it natively (AI meat grinders aside), but most devs will be able to pick up on the logic and convert it to actual code.

Disclaimer: am a programmer.

Edit: as an aside, manually dealing with time is its own form of madness and is usually best left to libraries (ie other people's code) whenever possible.

[–] ScrollerBall@lemmy.world 7 points 16 hours ago (1 children)

My favorite is the fact that Microsoft intentionally left a bug in Excel that treats 1900 as a leap year when it wasn't so they could maintain compatability with Lotus 1-2-3. And at this point fixing it would cause nearly every date value in excel files to display as off by one day and break a bunch of date formulas.

https://learn.microsoft.com/en-us/office/troubleshoot/excel/wrongly-assumes-1900-is-leap-year

[–] bamboo@lemmy.blahaj.zone 4 points 15 hours ago

Wow I've seen some really weird backwards compatibility issues, but this takes the cake. I would have imagined that in the move to XLSX they could have addressed this and sorted it out when saving, but nope, I guess having all days off by one and maintaining a support page explaining Lotus123 backwards compatibility for forever is earlier?

[–] weker01@sh.itjust.works 2 points 17 hours ago

Can confirm Source: am a grammerpro

[–] b000rg@midwest.social 7 points 17 hours ago

This is honestly exactly what programming is: breaking down big problems into step by step simple problems. If you've never considered taking up programming before, I'd suggest you try it sometime and see where it takes you. It's not hard to learn, it just takes time.

[–] vinyl@lemmy.world 6 points 19 hours ago

You should program

[–] bandwidthcrisis@lemmy.world 3 points 17 hours ago

COBOL is an old language Internet to make programs look a bit like English descriptions of what was needed.

I don't really know it, but your code reminded me of the idea of it.

Don't worry if your code is incorrect, just make random changes until you hit on something that no longer results in errors :)

[–] Kolanaki@yiffit.net 23 points 21 hours ago (2 children)

You don't even need to convert anything if they meant 5am.

[–] synae@lemmy.sdf.org 2 points 9 hours ago* (last edited 9 hours ago)

Yea, you just disown them as a friend and walk away

A real friend would never make you do something that early

[–] Aurenkin@sh.itjust.works 7 points 17 hours ago

Why'd you have to say 5AM instead of just 5? Now I need to convert it to 24h time

[–] NegativeLookBehind@lemmy.world 16 points 21 hours ago (2 children)
[–] renzev@lemmy.world 16 points 21 hours ago (2 children)

yeah, adding twelve to a single-digit number really does make my brain freeze like that. Something something can't do math under pressure.

[–] JustAnotherKay@lemmy.world 3 points 15 hours ago

This might help you: you're not adding 12 to a single-digit number. Just do 2 + x then throw a 1 in front, or add 10. Whichever is easier to conceptualize. (Where x is the single-digit number, in case that needed clarifying)

[–] NegativeLookBehind@lemmy.world 6 points 20 hours ago

That's OK, champ.

[–] sleen@lemmy.zip 5 points 20 hours ago
[–] FartsWithAnAccent@fedia.io 8 points 20 hours ago (1 children)

Just add 12 like a math nerd

[–] Crashumbc@lemmy.world 1 points 17 hours ago (2 children)

Except that is incorrect for 12am.

[–] funkless_eck@sh.itjust.works 3 points 7 hours ago

truly the hardest challenge to work out what 12am is in military time

[–] Omnipitaph@reddthat.com 4 points 16 hours ago (1 children)

12am is the 24th hour, so yes it still works. I could be wrong, but I'm not.

[–] Crashumbc@lemmy.world 5 points 9 hours ago (2 children)

Jesus does no one know 24hr time? No it is not it is the first hour...

12:10 am = 00:10 in 24hr time...

[–] Omnipitaph@reddthat.com 1 points 2 hours ago* (last edited 2 hours ago)

You're still not correct. Here

You are correct that 12:10 is 00:10, but that's not what was said. I said 12am is the 24th hour.

Plop in 24:00 into military, guess what you get? 12am my guy.

I'll explain why this is the case. 12am is marking the 12th hour of the evening, 12:01+ is counting into the first hour of the next morning. Same with 24th hour, 24:00 is the end of the 24th hour. There is no 24:01, it rolls around to 00:01 marking the first minute of the next day. 24:00 still exist though, it marks the massing of the last minute of the last hour of the day.

[–] FartsWithAnAccent@fedia.io 1 points 9 hours ago

"Is that 24:00 AM or PM?"