Most voted "strtotime" questions
PHP function for analyzing and converting any description into text over date and time to a Unix-style timestamp.
Learn more…18 questions
Sort by count of
-
4
votes1
answer237
viewsLimit to the strtotime function in php
I’m using the strtotime function as an example below, with cakephp. by spending the sum of 50 years is returning null, the most I can return is adding 20 years. Would anyone know if this is a…
-
4
votes2
answers2021
viewsSum with dates and strtotime in PHP
In this small script of a service system, I save the beginning of the service (field DATETIME bank) and the estimated term of its end (field TIME at the bank). Look at: $d1 = "2019-09-23 12:30:00";…
-
3
votes2
answers1735
viewsDate being recorded wrong in m-d-Y bank instead of Y-m-d
I set the date format for viewing to "d-m-Y", while the recording format is from the "Y-m-d" bank". However at the time of recording in the database, something happens and the data is going in the…
-
3
votes2
answers7685
viewsReturn correct php strtotime date
I have the following line echo date('Y-m-d', strtotime("28/09/2016")); // 1970-01-01 How do I return 2016-09-28? If the day is less than 12, returns...
-
2
votes1
answer1019
views-1 Month does not return to the previous month - PHP
Wore the strtotime() to return to the previous month and always take the last day of the previous month, did so: $data_teste = date('Y-m-t', strtotime('-1 month')); And it was working so far…
-
1
votes1
answer1329
viewsComparison of PHP dates - dd/mm/yyyy
I’m looking to do a PHP date comparison of the type: if Datastart >= Datatoday + 3 days, do such a thing. Otherwise, do nothing. I tried something like this: if…
-
1
votes2
answers412
viewsProblems to convert data mon dd yyyy hh:mm
I made a select in SQLSERVER inside 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 INNER JOIN…
-
1
votes1
answer26
viewsAdd value to a reference value determined each different day for the whole year
How can I add a certain value to an existing value each day other than the year. Something like: $hoje = date('Y-m-d'); $amanha = date('Y-m-d', strtotime($hoje .' +1 day')); if ($hoje != $amanha) {…
-
1
votes0
answers26
viewsTimestamp in Django (Reference)
I need this: strtotime('+10 days'); = PHP in Django I tried: import time struct_time = time.strptime("+10 days") print "returned tuple: %s " % struct_time Well, in all the documentation it doesn’t…
-
1
votes1
answer38
viewsChange from day to month when adding minutes: Why does it occur? How to fix it?
I wonder why in the code below, after adding the 15 minutes, there is a change in the order of day and month. What’s the logic behind it, if that’s what I’m thinking. Plus, how to fix this in PHP…
-
0
votes2
answers3045
viewsFormat PT BR date and time return in PHP
I’m using the function strtotime of PHP to format the date that come in the database SQL SERVER and is working normally on the local server, but on the web returns the date 12-31-1969 21:00 PM.…
-
0
votes3
answers81
viewsWorking with date and deadline checks
I’m a logical problem in my application. Guys, here’s the thing, in the project module of my system there is a deadline for delivery of the project. I need to know the following. If today’s day is 1…
-
0
votes2
answers44
viewscompare day between dates
I have a form where I compare two dates ( dt_ocorrencia e dt_prev_entrega ) and I bring the result, so far everything ok. | However I would like to type in one of the fields. follows code.…
-
0
votes2
answers90
views -
0
votes2
answers299
viewsTransform PHP strtotime in minutes
I am testing a code, to show the difference of date and current time with the variable in minutes <?php $phpdate = strtotime( $data ); $mysqldate = date( 'd-m-Y H:i:s', $phpdate ); $data1 =…
-
0
votes2
answers97
viewsCheck if time interval is within another range
I need to know if it was worked within a fixed interval $entrada_padrao = strtotime('08:00');//fixo como parametro $saida_padrao = strtotime('18:00');//fixo como parametro $entrada_trabalho =…
-
-1
votes2
answers184
viewsDiscover time interval
I’m trying to figure out the time interval between two strings with the strtotime. One has the complete temple and the other varies from minutes to hours, the problem is that when there are minutes,…
-
-2
votes1
answer35
viewsHow to turn Y-m-d to Unix midnight timestamp into PHP?
Good afternoon, I need to convert the data from a form that comes in the format ex: 2018-02-13 for UNIX at midnight. If I convert normally using strtotime it comes right but with the time of 6:00AM.…