Tamamlanmış

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

Beceriler: PHP, MySQL, JavaScript, HTML, SQL

Daha fazlasını gör: 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

İşveren Hakkında:
( 15 değerlendirme ) Tlalnepantla, Mexico

Proje NO: #27906714

Seçilen:

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

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD
(18 Değerlendirme)
4.7

Bu iş için 10 freelancer ortalamada $17 teklif veriyor

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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(206 Değerlendirme)
6.9
(130 Değerlendirme)
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(82 Değerlendirme)
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 gün içinde
(47 Değerlendirme)
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 ✅ Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(10 Değerlendirme)
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 gün içinde
(2 Değerlendirme)
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)
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 gün içinde
(1 Yorum)
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 gün içinde
(0 Değerlendirme)
0.0