Questions tagged as 'strtotime'

1
answer

Limit for strtotime function in php [duplicate]

I'm using the strtotime function as shown below, with cakephp. by passing the sum of 50 years it is returning null, the maximum that I can return is summing 20 years. Would anyone know if this is limiting / configuring cakephp or php itself...
asked by 25.01.2016 / 15:01
2
answers

Date being recorded wrong in bank m-d-Y instead of Y-m-d

I set the date format for viewing to "d-m-Y", while the recording format is the "Y-m-d" bank. However at the time of recording in the bank, something happens and the data is going in the format "mdY", and with that the data will be truncated,...
asked by 22.12.2013 / 23:37
1
answer

-1 month does not return to previous month - PHP

I used strtotime() to go back to the previous month and always take the last day of the previous month, I used to do this: $data_teste = date('Y-m-t', strtotime('-1 month')); And it was going on right up to today (31-10-2018), instea...
asked by 31.10.2018 / 15:33
2
answers

Return correct date strtotime php

I have the following line echo date('Y-m-d', strtotime("28/09/2016")); // 1970-01-01 How do I get back 2016-09-28? If the day is less than 12, it returns true ...     
asked by 17.08.2016 / 15:23
2
answers

Problems converting data mon dd yyyy hh: mm

I made a select in SQLSERVER within php: mssql_query(SELECT TOP 1 ven.DATA FROM tab_venda ven (nolock) INNER JOIN dbo.tab_item_venda iven (nolock) ON iven.num_Venda = ven.NUM_VENDA...
asked by 24.09.2015 / 16:57
1
answer

Date Comparison PHP - dd / mm / yyyy [duplicate]

I'm wanting to do a date comparison in PHP of type: if DataStart & Date = DateTime + 3 days, do such thing. Otherwise, it does nothing. I tried something like this: if ((1/86400)*(strtotime($_SESSION['buscaReserva']['dataInicio'])-strtotime(...
asked by 23.06.2015 / 15:22
2
answers

compare day between dates

I have a form where I compare two dates ( dt_ocorrencia e dt_prev_entrega ) and I bring the result, so everything is ok. But I would like to type in one of the fields to update the result. code follows. </div> </di...
asked by 12.08.2016 / 19:37
2
answers

Format date and time return PT BR in PHP

I am using the strtotime function of PHP to format the date that comes in the SQL SERVER database and is working normally on the local server , but on the web it returns the date 12-31-1969 21:00 PM. Does anyone know why? (As it is recorde...
asked by 01.02.2017 / 15:30
2
answers

Date function with two variables

I'm trying to concatenate a date and time so that they get the value (ISO) in MySQL so that I can insert them into the database. The line of code is this: Example: datai = 20/04/2018 and horai = 14:27 $data = '$_POST[datai]';...
asked by 20.04.2018 / 12:15
3
answers

Working with date and deadline checks

I am a logics problem in my application. Galera is the following, in the project module of my system there is a deadline for project delivery. I need to know the following.    If today is 1 week (7 Days) before the deadline, send the yellow t...
asked by 10.05.2016 / 02:26