Færdiggjort

Date format in difference using DateTime and date inside MySQL table

I'm working in some datatables for a ticket system that have SLA's, the ticket database is under MySQL

The SLA's are that the ticket must be solved within 45 min otherwise a warning label appears next to the ticket number

I'm using this method:

$start_date = new DateTime(''.$rows->created_time.'');

$since_start = $start_date->diff(new DateTime("now"));

$project_id_td .= '<a href="'.$href.'">CITA-'.$project_id.'</a>';

if ($since_start->i > 45)

{

$project_id_td .= '<span class="label label-danger pull-right">Incumpliendo</span>';

}

Only works if establish the flag with days ($since_start->d > 1), but minutes or hours it gives me random numbers

I assume the problem is caused by the date formats

In the database the dates are like this:

2020-10-25 13:46:49

Evner: PHP, MySQL, JavaScript, HTML, SQL

Se mere: project vba date format, convrt data date format sql, hours date format access database, mysql timestamp, mysql date format, mysql datetime vs timestamp performance, mysql date type, mysql datetime timezone, mysql insert datetime, mysql datetime vs timestamp, mysql datetime, scriptaculous date format, date format asp via, vbnet using folder date modified, copy date text date format excel, vb6 date format, calculate date difference using scripts infopath 2007, excel changes date format csv, date format indiancnet, date format

Om arbejdsgiveren:
( 15 bedømmelser ) Tlalnepantla, Mexico

Projekt ID: #27906714

Tildelt til:

chrisklick

Hello Its just a piece of cake to me. No need to talk long. I can do it right now. Lets discuss more detail via Chat. Hope to hear from you soon. Best Regards

$15 USD på 1 dag
(18 bedømmelser)
4.7

10 freelancere byder i gennemsnit $17 timen for dette job

abugosia

Hello, I'm Abu Gosia. I'm interesting in your project very well. Please give me access so I can make working code for date with condition. I'm good in Website Design, Yii2, PHP, Laravel, Codeigneter, Wordpress, Open Ca Flere

$15 USD på 1 dag
(206 bedømmelser)
6.9
(130 bedømmelser)
6.0
phplogics00

==================== i can print in your required format like as dd-mm-yy or dd/mm/yyyyy etc within few min $date1=date_create("2013-03-15"); $date2=date_create("2013-12-12"); $diff=date_diff($date1,$date2); echo $diff Flere

$18 USD på 1 dag
(82 bedømmelser)
4.8
custdeal

hello sir good morning i am ready to start work for you as per your requirements can you please share source code with me so that i can check it and fix it waiting for your positive response thank you so much

$20 USD in 7 dage
(47 bedømmelser)
5.0
masadmajid

I am professional web developer. I have experience in many web languages and frameworks i.e ✅ HTML ✅ CSS ✅ Bootstrap ✅ JavaScript ✅ jQuery ✅ Ajax ✅ PHP ✅ CodeIgniter ✅ Laravel ✅ Vue.js ✅ MySQL ✅ PostgreSQL ✅ MongoDB ✅ Flere

$15 USD på 1 dag
(10 bedømmelser)
3.4
Iloveartdigit2

it is very easy job and I can complete it in a short time Please contact me thanks

$20 USD in 7 dage
(2 bedømmelser)
1.7
demydkasilov

⭐✅Dear Client, How are you?✅⭐ Thank you for your job posting I hope you are well and staying safe without COVID-19 effect It seems to be an interesting work and a good opportunity to show my web skills to work with yo Flere

$20 USD på 1 dag
(1 bedømmelse)
0.7
SuperDima

Hello. It is because of the Date Format. Please give your PHP code. I can help you to fix it. Thanks.

$15 USD in 7 dage
(1 bedømmelse)
0.6
MdJohne

Hi there, I understand your requirement. I'll do all your [login to view URL] send me a message to discuss more. I am available to start working on the project immediately.

$15 USD in 7 dage
(0 bedømmelser)
0.0