Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "datetime"
-
If we ever colonize Mars or if we even go further I am already feeling sorry for the poor bloke that will have to work on DateTime library.9
-
Imagine a database table where dates were saved as strings from raw user input. Then do migration to other database with table where dates are datetime.
Yep. That's me. 😶
I hate humans. 😧🔫
Especially those who try to be original like:
11|Sept.|2016 or 13;Juni;17
There are rules in this world, damn. 😥9 -
That moment that you come across a domain name which you thought would have definitely been taken already.
Came across strtoti.me. (php function for converting date/time strings into unix epoch's). Quickly wrote an api for it and put it online because fuck it, why not!
Feel free to use it as much as you want, I can't guarantee its availability unless it would become really popular but I can't imagine that.
URL: https://strtoti.me
API example: https://strtoti.me//... 20 20:15
API example (url encoded): https://strtoti.me//...
API documentation (not that good yet, might improve it..): https://strtoti.me
Well, let's see how this goes. Feedback appreciated but I currently have a shitload of projects to it doesn't have the highest priority right now!12 -
Teaching new recruit some SQL (even though hes supposed to fucking know SQL and have multiple years experience but I was a contractor and idgaf, not messing up my money. Just fucking annoying to have an idiot around you all the time).
Me: Okay, so sys tables, so this one is for jobs yeah?
Him: Yeah
Me: Okay, so in this table, its obviously not one row per job per step cos you have multiple rows for the same job and step. Also, there is a datetime field, so what is it showing?
Him: Hmmmmm..... (after some time, back and forth we get to the answer).... history table
Me: Cooooooool, okay, so, lets say, I have a job with 5 steps. If i run it once, how many rows will be in this table?
Him: 5 rows.
Me: Correct, so if I were to have run this same job, 10 times, how many rows get inserted into the table?
Him: (Now...you have to understand, how long this thought process was, im trying to fill the gap with words but really, he was like, having a flashback or something...I kept quiet but silently wanting him to say anything....then he looks me dead in the eyes).... 10!
Me: Motherfucker what!?!? 10 What? If 1 time == 5, what does 10 times ==?
Him: Hmmmmmmmmm.... (yes...we are doing this whole flashback montage all over again)....... Ohhhhh, 1!
Me: .....Stop, think, its a history table. It holds history, for when every step is run for a job, why would it be only one row?
Him: OMG, I know what a history table is!!!!
Me: (Pissed off cos I don't take disrespect calmly). Fine, genius, answer, go!
Him: (LONGER WAIT THAN LAST TIME!!!!)....is it not 10?
Me: I swear, I'm gonna kill you one of these days.
Him: *chuckle*
Me: No...seriously....
TOOK 20-30 MINUTES FOR HIM TO SAY 50!!!!!!
And even then, I swear he didn't understand why. Serious, he was a special breed, had a manager that was a super tard and when I worked here, the spirit of that manager possessed this idiot, the CIO and his little right hand bitch zzzzzzzzzzzzzzzzz.
If there was ever a time I was willing to catch a case at work, it was there.
Bonus: Serious, it got to the point I had to come in and tell this idiot that he can only ask me questions today if he calls me by my name...and my name has changed today...and no, you can't ask me for it cos you need my name to ask me questions.....FUCK OFF kkthxbai.5 -
import datetime
age=19
while not dead:
today=datetime.datetime.today()
if today.day == 1 and today.month == 4:
age+=1
print("🎉")11 -
Found this little gem today in some legacy code at work.
Apparently this is the best way to split a datetime (hh:mm:ss mm/dd/yyy).
If only there was a function that could split a string by keying off characters.
Oh wait there is....
I decided to give it a comment memorial.7 -
My boss back in 2013 asked me to figure out why he was getting birthday notifications from his pet social media project almost a week early. It turns out the previous developers had written their own date library in which every month had exactly 30 days, leading to a year that was 5–6 days short of what it should have been. Apparently those morons didn’t know that some months have a different number of days than others. Or that leap years are a thing. Or that there’s a standard library full of tried-and-true functions that handle these kinds of things for you.5
-
Javascript being Javascript...
var date = new Date()
Mon Aug 13 2018 09:17:28 GMT+0200 (Mitteleuropäische Sommerzeit)
date.getDay()
1
date.getDate()
13
date.getFullYear()
2018
date.getYear()
1186 -
Countries in UTC region have a relative advantage in debugging, as they don't have to add offset to datetime in logs,database etc to convert to localtime😂6
-
🐉
I once wrote a room planning application on unity, to allow people in my company to book meetings using tablets attached to the room doors.
Turns out the c# Datetime object unity uses was highly localized and therefore had a different formats on each different device.
I saved those timestamps into a SQL database and eventually all devices crashed due to having some Datetime format they could not parse.
Had to fully bypass the datetime and reinvent it essentially and had to reset the database.
I think it's needless to say I'm not particularly good in dating.4 -
Started work on redeveloping a module for our system, I look at the database document and see two fields, one for date and one for time. Both are full date time and the data is stored like so:
Date I want to store: 2016-04-09 05:54:00
Date: 2016-04-09 00:00:00
Time: 1899-01-01 05:54:003 -
Rant. (I love and respect all people! Especially developers.)
You frontend imbecils! I just can’t deal with you any more. I’ve had it.
Stop-inventing-new-components-where-there-are-fully-developed-and-working-concepts!
I mean. Just fucking stop! If I see another worthless datetime picker with an ”innovative” design I am going to hunt you down and freaking scream in your face.
And make fucking buttons look like tappable/clickable. It’s not fucking hard! Imbecils.
Oh, ooo, look at me, I am a frontend developer and I am in UX la-la land and what I am doing is sooo hard. Fuck off with your fucking moving gradients and n:th-child childish playground.
”Yeah, I exchanged the spinner…”
Fuck you. Your not contributing. Nobody cares! We’re not doing anything for the business by having a web which can be seen on a fucking telephone. EVERYBODY IS SITTING WITH SEVERAL GIANT MONITORS AND A FUCKING WORKSTATION FOR THIS. NOBODY ASKED FOR IT. AND YOU SPEND COUNTLESS HOURS ON IT.
”Yeah, I made the site work on ipad”
Please. Why? It’s not worth anything. Zero value.
”Yeah, the toggle component is now changed since we started to use the biddle-flipflup lib and it works almost the same”
No! NO! It does not work ”almost” the same. The psychology of the toggle is now wastly different. What was On before now looks like Off and it is fucking worse!!!
Imbecils. I hate you.
And no, I can’t do your fucking work! And I know that you do other non-ui stuff as well sometimes… but anyway… I have no interest to be in that clusterfuck that modern frontend is today. It was really fucking bad twenty years ago and it is just as bad today and you are not helping.
”I’ve improved the button so now it aaaaalmost does not look like a button. But I am getting there!”
Fuck you.14 -
Date of doom... they forgot the double quotes...
(btw. $dateString is in the form "1234-10-11")
The fun part is that this comparison fails because $dateString is not numeric (due to "-") thus won't be (non-strictly) equal to 0 (int).
Damn fuucking amateurs... all hacks no skill.10 -
I'm debugging someone else's 10 year old legacy .asp web application (shoot me now), and I'm trying to find the most recent records in a database table.
Why is the most recent record from September of last year?
Oh.
Because they're storing the datetime value as varchar (40).
Good thing they were smart enough not to waste disk space by using varchar (255)!4 -
There are so many weird hacks in the quite legacy app I work with I could write a book about all them hacks…
But I must admit, the worst of them all is internal time. Yes, so some blockhead thought it’s a good idea to represent time in a manner completely removed from Datetime objects or timestamps or even string representations. Instead we deal with them as intervals represented by integers - and because this is not fucked up enough by itself, the internal time doesn’t start at midnight, yet the integer representations do. It’s a bloody mess. No wonder most of the bugs we face have to do with dates and time…5 -
ARGH. The moment you realise the previous developer centralised ALL of the current software around a M$ access dBase. WTF. Same dude also stores day of year, week of year, month number and year as seperate fields in a MySQL dBase. Alongside a datetime stamp. OMFG!!!!9
-
Python is GREAT 😊😊
makes you feel happy (😊) when fix a datetime problem just in 14 lines...
(36 lines in javascript ☺️)13 -
Valid from, valid until.
Who else has this irrational feeling that in some edge case, it might be not long enough?24 -
My preferred stack is Rails/NginX/Postgres, or Node using the same.
I have a fair amount of material for this week's rant, but in my stack's defense, the quantity is primarily because I've been using it for so long, and I'm apparently a talented breaker. I may share other stories if the motivation arises.
However, today I ran into something definitely deserving of calling out.
The default datatype for a Date+Time column in Postgres is `datetime` which means "date+time without timezone". (while `datetimetz` instead stores the timezone).
Apparently when comparing a datetime with a datetimetz, Postgres doesn't compute the timezone difference correctly, leading to some very unexpected and confusing query results.
Today, I had a record that was both pending (expires_at > now) and expired (expires_at <= now), where now is a DateTime (with tz) literal from Rails. After half an hour's frustrated delving and baffled expressions at query results, I finally figured out that the database's math was incorrect when comparing UTC (+0) and PST (-7).
This during a semi-high-priority bugfix that's blocking for a coworker.
While Time and all of its nuances are honestly extremely difficult to handle correctly, I didn't expect Postgres to get this relatively simple part wrong.
Shame on you, Postgres.
I expected better.3 -
FUCK YOU PHP, WHY THE FUCK DO YOU GIVE ME DECEMBER 1ST WHEN I DO
strtotime('-1 month', '12/31/2015)
USING DateTime PRODUCES THE SAME FUCKING RESULT. ARE YOU FUCKING RETARDED OR WHAT?
YEAH I KNOW NOVEMBER DOESN'T HAVE 31ST BUT YOU COULD AT LEAST RETURN 30TH OR EVEN RAISE A WARNING, YOU FUCKING PIECE OF SHIT.10 -
Why do the java people say that java is superior over C#, when in fact it is more or less the same language? I never hear C# guys crying that their language is better, but I hear java guys all the time. And the fact is even that C# has more language features IMO makes it a better language. .Net is more or less the same as the Java API but we have had DateTime objects and a lot of good things, that Java is now copying, for a long time. Just curious on some ideas why Java is better now and forever no matter what times infinity, but why? And if someone is so stupid as to write that Java is the better language without reading this far then that proves my point. ps. Now that .Net and C# is being open sourced there is not the open source argument anymore either22
-
List of shit my superior said and wrote in the project:
1. Prefer to write "pure" SQL statement rather than ORM to handle basic CRUD ops.
2. Mixing frontend and backend data transformation.
3. Dump validation, data transformation, DB update in one fucking single function.
4. Calculate the datetime manually instead of using library like momentjs or Carbon.
5. No version control until I requested it. Even with vcs, I still have to fucking FTP into the staging and upload file one by one because they don't use SSH (wtf you tell me you don't know basic unix command?)
6. Don't care about efficiency, just loop through thousands of record for every columns in the table. An O(n) ops becomes O(n * m)
7. 6MB for loading a fucking webpage are you kidding me?
Now you telling me you want to make it into AJAX so it'll response faster? #kthxbye2 -
The human in me knows casting a datetime to a decimal(20, 12) is fairly future-proof.
The dev in me is worried someone working at the same company in 273669 years will get mad at him.5 -
When the previous dev has written all datetime query lookups by date only, resulting in any values for the ladt day of the month to not be included.
THANK YOU.
Same wanker has copied and pasted same 100 lines of code over and over and literally changed one value in between. Obviously never heard of a function.3 -
Ok now I'm gonna tell you about my "Databases 2" exam. This is gonna be long.
I'd like to know if DB designers actually have this workflow. I'm gonna "challenge" the reader, but I'm not playing smartass. The mistakes I point out here are MY mistakes.
So, in my uni there's this course, "Databases 2" ("Databases 1" is relational algebra and theoretical stuff), which consist in one exercise: design a SQL database.
We get the description of a system. Almost a two pages pdf. Of course it could be anything. Here I'm going to pretend the project is a YouTube clone (it's one of the practice exercises).
We start designing a ER diagram that describes the system. It must be fucking accurate: e.g. if we describe a "view" as a relationship between the entities User and Video, it MUST have at least another attribute, e.g. the datetime, even if the description doesn't say it. The official reason?
"The ER relationship describes a set of couples. You can not have two elements equal, thus if you don't put any attribute, it means that any user could watch a video only once. So you must put at least something else."
Do you get my point? In this phase we're not even talking about a "database", this is an analysis phase.
Then we describe the type dictionary. So far so good, we just have to specify the type of any attribute.
And now... Constraints.
Oh my god the constraints. We have to describe every fucking constraint of our system. In FIRST ORDER LOGIC. Every entity is a set, and Entity(e) means that an element e belongs to the set Entity. "A user must leave a feedback after he saw a video" becomes like
For all u,v,dv,df,f ( User(u) and Video(v) and View(u, v, dv) and feedback(u, v, f) ) ---> dv < df
provided that dv and df are the datetimes of the view and the feedback creation (it is clear in the exercise, here seems kinda cryptic)
Of course only some of the constraints are explicitly described. This one, for example, was not in the text. If you fail to mention any "hidden" constraint, you lose a lot of points. Same thing if you not describe it correctly.
Now it's time for use cases.
You start with the usual stickman diagram. So far so good.
Then you have to describe their main functions.
In first order logic. Yes.
So, if you got the point, you may think that the following is correct to get "the average amount of feedback values on a single video" (1 to 5, like the old YT).
(let's say that feedback is a relationship with attribute between User and Video
getAv(Video v): int
Let be F = { va | feedback(v, u, va) } for any User u
Let av = (sum forall f in F) / | F |
return av
But nope, there's an error here. Can you spot it (I didn't)?
F is a set. Sets do not have duplicates! So, the F set will lose some feedback values! I can not define that as a simple set!
It has to be a set of couples, like (v, u), where v is the value and u the user; this way we can have duplicate feedback values in our set.
This concludes the analysis phase. Now, the design.
Well we just refactor everything we have done until now. Is-a relations become relationships, many-to-many relationships get an "association entity" between them, nothing new.
We write down on paper every SQL statement to build any table, entity or not. We write down every possible primary key or foreign key. The constraint that are not natively satisfied by SQL and/or foreign keys become triggers, and so on.
This exam is considered the true nightmare at our department. I just love it.
Now my question is, do actually DB designers follow this workflow? Or is this just a bloody hard training in Pai Mei style?6 -
Fuck this I need to ventilate.
Thinking about job change because maintaining and extending 3 years old codebase (flask project) is FUCKIN exhausting. It was badly written since start by someone who obviously didn't know much about python. (Going by commit history.)
Examples:
- if var != None / if var == None
- if var is not None / if var is None (well..)
- Returning self-parsed obscure JSONs from dict variable
- Serializing dictionaries into database by str() (both sqlalchemy and mysql support JSON format) - THEY ARE ALMOST UNUSABLE OTHER WAY AROUND (luckily, python can deal even with that)
- celery tasks, the way they are called they BLOCK the whole flask (not bad in itself, but if connection breaks there are no errors, nothing it just hangs)
- obscure generator/yielding that contains return of flask's response in itself
- creating fifteen thousands of variables one by one where they would look so nicely as dict keys, and hey they are then both MANUALLY SERIALIZED into returning dict by "%s" (string formatting) [okey, some of them are objecst like datetime but MATE WTF]
- many, many more, PEP lint shall not pass
I would rather deal with fresh startup owners wanting me to program unicorns in one week then trying to extend and manage zombie-like projects.
Nothing personal against the firm I actually like the place.3 -
Get a DateTime. Convert to a string. Convert back to a DateTime. Use that DateTime to build a string.
WHY.
(it's red because I refactored it; snipped copied from our version control)3 -
Today I learned that some external devs one of our projects is working with have DB tables where they store references to specific dates, and not only that, but every minute of those dates, and the day of the week, and what season its in. Im not joking.
Hmm should I use the local datetime libs or should I go through a firewall, load balancer and DB cluster just to find out what day it is? -
cant we already get to a point where we have one single fat datetime format in CS...
ISO this, RFC that, UNIX those10 -
Microsoft.Graph has filtering capabilities for dates, which is great.
Format is: "2018-04-12T12:00:00Z"
Doesn't natively support string conversion of a DateTime to match the pattern... Nor does Graph accept any date formats such as the "s" parameter for sortable dates, which goes into milliseconds, etc.
DateTime.ToString("derp");
Sometimes I wish I was a Java Dev.1 -
You ever tried to debug a date bug when IT has blocked you from modifying your system time? I wouldn't suggest it.2
-
Difference between 2023-01-01 00:00:00 and 2023-12-31 23:59:59 is 11 months, 29 days, 23 hours, 59 minutes, 59 seconds ; so almost a year (by one second)
Difference between 2023-01-01 00:00:00 and 2023-01-31 23:59:59 is the same, almost a month by 1 second.
Same for february (even with 28 being the last day).
But then, 2023-03-01 00:00:00 and 2023-03-31 23:59:59 gives me :
1 month, 2 days, 23 hours, 59 minutes, 59 seconds.
WHY, are there fucking 34 days in March ? Is this a bug ? Is it confused with February being the previous month ?
Why would PHP do this to me ?
Why the hell is it always so painful to work with dates, it's not even like I'm stretching the standard library or using raw timestamps to hack things together
I used the diff method of PHP 7.4 DateTime, is someone wants to try it24 -
When every related field has a god damn different way of working with the data on hand..
For example:
`tht_date` ("Y-m-d", Date) - expiration date on the product, hence, there can be multiple of the same products with a different THT
`tht_alert` ("-2 months", varchar, DateTime modify mutation string) - sending an alert when this interval is hit, and being the activator of the tht_date field (unless value is "none")
`tht_minimum` ("28", integer, quantity of days before tht_date) - to lock them from being sent out/collected.
...
How would you expect this ×not× to become a friggin' spaghetti when trying to resolve the best row ID?
These values are in the wrong spot in the first place, then they also act entirely different in relation to eachother..
I hate the person that set this up, for doing this. When is the madness going to stop...
FFS!! -
Ok the ionic datetime component horror ended. I got it working good enough but I'm not proud of my code. The whole thing is a giant hack parsing dates to and from strings, switching locales, setting months and days and using the month as a daypicker as this fucking component does not allow me display day names in it, only month names. Such a mess... at least now I can work on the stuff that matters.
Actually though about making this open source... I reconsidered.8 -
I had a problem with too many backups from our personal data (Photos,videos etc.)
Always I had 1-2 hard drives to backup all important files every time.
Too many duplicates!!
So I created a batch file that for every image-video file type in my backup , will move only one in a new folder, sorted by daytime taken and in a folder of that year, then it renamed all with the datetime of the file.
Now I have a great backup sorted by year in folders since 2003. Just saved me from 2 terabyte duplicates and I have now 600gb sorted backup files!2 -
In 2020, the Earth slightly accelerated its spin.
For the first time in history, we need to add a *negative* leap second in our datetime systems.
...
Which means all the datetime libs need an update. I hope they anticipated this.20 -
When you need a really large date, are unsure of the system culture and have forgotten about `DateTime.Max`
-
Why the fuck is midnight 00:00 and midday 12:00? Every other hour is the same for Am and Pm in 12 hour time. I can’t find any explanation other than all of humanity being unable to count.
All date/time libraries must encounter this bullshit. There are so many similar levels of bullshit with everything related to time handling. Time zones, stamp formats, minimum intervals overflows are all so fucked.14 -
Daylight Savings Time.
Europe switches to DST this month and specs are broken because of Ruby's DateTime which isn't DST-aware so it generates invalid dates and can't do date math properly. Losing a couple days to refactoring horrendous code that uses *nested* Timecop.freeze, mixtures of Time, Date, and DateTime, math and parsing revolving around the end of the month.
Death to DateTime and death to DST.1 -
Here is a gem I found when looking at the previous offshore team's database.
So apparently they didn't know that SQL has an ALTER TABLE command to add new columns. So they created a brand new table, version 2, THEN migrated all the data over, every single time a new field was needed.
Then of course they had to update all their code that previously looked at the original table and the clients had to resync data onto the tablets as well.
Maybe they thought it was a good solution since they don't know what database versioning is (something they also manually implemented) or that ORMs exist.
**Sanitized the table names but kept the general structure, casing, etc
CREATE TABLE [dbo].[TVP_NameHere] AS TABLE(
[NameTime] [datetime] NULL,
[NameId] [int] NULL,
[somethingId] [int] NULL,
[fooId] [int] NULL,
[Time] [int] NULL
)
CREATE TABLE [dbo].[TVP_NameHereV002] AS TABLE(
[NewColumnHere] [int] NULL,
[NameTime] [datetime] NULL,
[NameId] [int] NULL,
[somethingId] [int] NULL,
[fooId] [int] NULL,
[Time] [int] NULL
)3 -
Now I'm a bit impressed by auto complete of VS2022.
The full text in grey is auto complete proposition.
Back story :
I have a table where datetime is stored as nvarchar(max).
I'm trying to convert that shit into a proper datetime2 column
But there are dates in ISO format, there are in MM/dd/yyyy, dd/MM/yyyy and there are some with hours/minutes parts.
So i'm making a little script to clean of all that up.
Ofc, not a perfect result, like 01/02/2022 will be considered as dd/MM/yyyy (98% of values are. But still cleaner than before1 -
So I had this JSON thingy, where I named the property containing a datetime string "timestamp".
For some reason, JS decided to convert that into a unix timestamp int on parse. Thx for nothing.6 -
from datetime import datetime
import devrant
while project_deadline > datetime.now():
devrant.rant()1 -
import datetime as dt
while(True):
time_left = 24
work_hours = 8
trained_today = False
while(work_hours>0):
do_work()
listen_to_music()
browse_interesting_feeds()
work_hours -= 1
time_left -= 1
while(time_left>0):
if trained_today == False:
train()
trained_today = True
eat()
if dt.datetime.now().hour > 23:
time_left -= time_left -
I found it!!!
The unicorn of nonsensical datetime formatting... In large scale official, current use!
It's actually dd/mm/yyyy !14 -
WTF!! Function that returns multiple outputs!! Why not make a datetime object and return the whole fucking object!!1
-
So I'm on one project which was previously developed (I mean poorly developed) by another firm.
So this fucking guy who has done all the coding, I just fucking hate that guy because he has the shittiest logic and he doesn't know things should always be dynamic.
So he has written code(in PHP) where he has calculated the difference between DateTime and he is adding days, hours and minutes to another DateTime.
And it took me fucking 5hours to realize that he just forgot there is a thing called month which should be considered while doing this, I mean WHAT THE ACTUAL FUCK?
It was calculating like the difference between
2018-07-12 and 2018-09-18 are FUCKING 6 DAYS WTF!!!! SERIOUSLY? HOW COULD SOMEONE MISS THIS?WTF?!!!! FUCKING 5 HOURS FOR THIS?
Hush!! I think it is my bad that I thought it is DateTime issue and focused on that. I feel good now. Thanks.1 -
DateTime now = DateTime.Today;
int age = now.Year - bday.Year;
MessageBox.Show("Happy " + age.ToString() + " birthday, devRant!"); -
Java8: "the prevoius 2 api set of handling datetime were cumbersome, and not friendly so we introduced a whole new set of api's from jodatime"
(Looks at the new api trying to figure out how to get milis difference between a date and a timestamp, wants to kill everything and everyone in sight)
If i have to Google every simple date operations someone needs to pay -
<?php
date_default_timezone_set('Asia/Kolkata');
$current_time = date('Y-m-d H:i:s');
$alarm = new DateTime('2016-06-13 04:05:00');
if( $current_time == $alarm)
{
wake_up();
eat('suhur');
pray('fajr');
browse('devRant');
browse('Instagram');
sleep(18000);
}
shower();
goto('friends office');
browse('YouTube');
work(14400);
pray('zuhr');
pray('asr');
goto('gym');
exercise(5400);
goto('home');
pray('maghrib');
eat('iftaar/dineer');
pray('isha');
goto('store');
work(7200);
goto('home');
sleep(7200);
?>11 -
Dear fucking MicroSoft,
I really like the C# language, but the default System types have some little fucks up.
Like, if the DateTime.ToString() accepts "HH" to display hours with leading 0, WHY THE FUCK DOESN'T TimeSpan.ToString()?
Truly yours,
ZioCain6 -
new DateTime().toString("yyyy");
//Output 2017
🎆🎆🎆🎆🎆🎆
Happy new year .
🎆🎆🎆🎆🎆🎆
Brought to you by JodaTime 😉 -
Read this and tell me OOP (or at least C#) isn't broken:
https://levelup.gitconnected.com/5-...
All I want to do is mock System.DateTime is for a few of my tests, and I ended up going down this rabbit hole of absolute horseshit: build a custom class that you can mock in tests, blah blah blah blah, uhhhh... YEAH NO
Such a simple functionality / need, and yet there is no easy way to test for it. Sigh.16 -
Noticed rants and comment dates on the app uses the users device datetime rather than the server's. Hence if my phone's date is fast forwarded to a week later and I make new posts it shows a week ago rather than just now, same for comments. Is this the expected behaviour?5
-
So, I just (few hours ago)made a new variable that's either brilliant or innately flawed... not sure yet. It's an oddly unique var...
__bs__
So far I only made it in python and windows env (i script like the methodology of css).
I bet you're wondering how I've defined __bs__ and the practicality of it.
__bs__ is derived from a calculated level of bullshit that annoys me to tolerate, maintain, etc. as well as things that tend to throw nonsensical errors, py crap like changing my strings to ints at seemingly random times/events/cosmic alignments/etc or other things that have a history of pulling some bs, for known or unknown reasons.
How/why did this come about now?
Well I was updating some symlinks and scripts(ps1 and bat) cuz my hdd is so close to death I'm wondering if hdd ghosts exist as it's somehow still working (even ostream could tell it should be dead, by the sound alone).
A nonsense bug with powershell allowing itself to start/run custom ps1scripts with the originating command coming from a specific batch script, which worked fine before and nothing directly connected to it has changed.
I got annoyed so took an ironic break from it to work on python crap. Python has an innately high level of bs so i did need to add some extra calculations when defining if a py script or function is actually __bs__ or just py.
The current flavour of py bs was the datetime* module... making all of my scripts using datetime have matching import statements to avoid more bs.
I've kept a log of general bs per project/use case. It's more like a warning list... like when ive spent hours debugging something by it's traceback, meticulous... to eventually find out it had absolutely nothing to do with the exception listed. Also logged aliases i created, things that break or go boom if used in certain ways, packages that ive edited, etc.
The issue with my previous logging is that it's a log... id need to read it before doing anything, no matter how quick/simple it should be, or im bound to get annoyed with... bs.
So far i have it set to alert if __bs__ is above a certain int when i open something to edit. I can also check __bs__ fot what's causing the bs. I plan to turn it into a warning and recording system for how much bs i deal with and have historical data of personal performance vs bs tolerance. There's a few other applications i think ill want to use it for, assume it's not bs itself.
*in case you prefer sanity and haven't dealt with py and datetime enough, here's the jist:
If you were to search any major forum like StackOverflow for datetime use in py, youd find things like datetime.datetime.now() and datetime.now() both used, to get the same returned value. You'll also find tons of posts for help and trying to report 'bugs', way more than average. This is because the datetime package has a name conflict... with itself. It may have been a bug several years ago, but it beeb explicitly defined as intentional since.2 -
Just spent 8h trying to load datetime fields from Django to db. It turns out that tzinfo in datetime field doesn't work well with my timezone.
-
Ah, the elusive 31st of June - the clients favourite date. Also the DateTime parsers least favourite date.
-
"We would really prefer it if you didn't attempt to print time zone offset with your DateTime values (because that functionality is utterly borked and prints nonsense)."
From documentation of .Net DateTime. -
Senior: Rule out the idea of making one class "Receipt" for all kinds of receipts, it should have the same load info + operations{emp,operationType, datetime, oprationDetails}
Junior: How you want to generate a detection receipt
Senior: Make a VM for the receipt
Junior: What if there is an edit on the load while moving through operations, what happens to the receipt?
Senior: OK, shove up the fucking edit details as an operation in the receipt ass2 -
Timecalculations and Datetime manipulation from UTC to locale where locale can be anything are by itself annoying but Javas Date and Calendar APIs always make me feel like "Seriously?! Fuck you! What do you want from me?! "
Argh....
Wasting so much time right now to get a fairly easy app built as showcase for new customers and continue with my life!2 -
So int and datetime are not nullable in c#, so you cant assign null to them
While you can't compare int to null (int a; a==null won't compile) you can do it with datetime objects.
Microsoft, can you please get your shit together?
Took me like an hour to realize my date is actually the 1.1.0001 and not null.1 -
conversation wth a progrmmr
Bab : hey hun when is your Birthday?
Jerk_Guy : import datetime
now = datetime.datetime.now()
now + datetime.timedelta(days=88)1 -
New version, new regression tests. It's the first time I'm trying to run them fully automated. Tests were ok separately, but as it turns out, "random" generated number is not OK for creating unique names if it's being created from datetime (yymmddmmss), and tests run within one minute.
Also, new version broke our hack of disabling browser pop-up confirmations. Fuck.1 -
perl -MCPAN -e 'shell;'
install DateTime
Proceeds to install a shit ton of dependencies, takes two hours to install.
WHY? Does math functions related to date/times require all those deps?4 -
!Rant
I've got somewhat of a problem: a client claims that the date format at a website is wrong. I am using Carbon for Date output which extends PHP's DateTime which uses the Linux locales. Can someone here confirm that they have seen a similar but that the date is wrong in Romanian, slowenian and Czech? (The format would be somewhat like wednesday, 17. January 2017).