|I'm working on a project written by 3 Chinese kids from China that were here at UC Irvine to study back in 2000 written in PHP over the course of 8 years. They made some bad choices in database design and I'm not about to change the database since I don't have a full understanding of how the program works. Well I do now after rewriting the PHP since Feb 2021. These kids had disrespect for HTML as well, and the worst programming disciplines I have ever seen.
In PHP 7.4, converting the date to a ISO formatted string speed ed up the process of converting that date into a PHP date object for my Calculation.Factory.PHP to process formulas, which generates the cost of an activity or specific job in the construction industry. And for some reason, technical, writing a PHP date back to SQL server required a different date conversion in SQL.
What was most frustrating was reading a date in SQL, and writing it back to another table in the same format, and SQL server would not write it unless it was in a certain ISO format.
The main point of this project was to get the existing code re imagined and upgraded from PHP 4.2 to PHP 7.4+ to extend the life of the application another 20 years.
I know why the dates had to be converted but I don't know how to work around this without altering the database design at this point in time. Excellent question which is making think about the dates again.
The original SQL did cast the date, but I can't remember at the moment why I had to remove the CAST, that was 8 months ago.
If it ain't broke don't fix it
Discover my world at jkirkerx.com