strtotime Questions
2
Solved
I want to store the date of birth as a UNIX timestamp in my database, because this keeps the database small and it speed up the queries.
However, when converting the date of birth to a UNIX time u...
2
Solved
I have a datetime value I want the difference between that datetime and datetime now .. I tried to convert it to timestamp and calculate the difference but I got a negative value. How to get ...
1
Solved
After some messing around with strtotime() in PHP I noticed that it gives a valid timestamp back when you pass in spaces and or dots.
var_dump(strtotime(" "));
var_dump(strtotime("."));
var_dump(s...
4
Solved
I'm having a weird problem. When I do strtotime it's not considering the hours part of the original date, and it's always returning midnight. I tried to research but I couldn't find anything specif...
5
Solved
I have a script that gets the current and last month in PHP like so:
$currentMonth = date('m');
//Expected:07
//Result:07
$lastMonth = date('m', strtotime('-1 months'));
//Expected:06
//Result:07
...
5
Solved
here are some debug expressions i put into eclipse, if you don't believe me:
"strtotime("2110-07-16 10:07:47")" = (boolean) false
"strtotime("2110-07-16")" = (boolean) false
i'm using it in my...
1
Today is Friday, April 17, 2015. In my app, it automatically generated a "due date" for each assignment. It's set to "5 business days". To accomplish this, We use:
date('m/d/Y', strtotime("+5 week...
2
Solved
I'm working on a PHP function which calculates holidays:
function holidays($country = 1, $timespan_start = 0, $timespan_end = 0)
The holidays are returned as timestamps in an array.
Since I hav...
3
Solved
The following line:
echo date('d', strtotime('First Saturday August 2015'));
prints 08, which doesn't seem to make any sense because the first occurrence of a day of the week can't be after the ...
2
Solved
I want to get the timestamp of a day/time for eg
17/12/2014 8pm
Currently I am doing
$curtime = strtotime(date("Y-m-d H:i:s"));
which is giving me the current timestamp but I need to be of 8p...
4
Solved
I'm getting a time value from a database call in the following format:
HH:MM:SS
Here are some examples:
08:15:00
22:45:00
I need to however convert these and display them, using the above exa...
3
Solved
I have software that needs to determine if the cutoff datetime is greater than 24 hours from now. Here is the code I have to test that.
$date = strtotime("2013-07-13") + strtotime("05:30:00");
...
1
Solved
I'm looking for the next Thursday after a specific date, say 2014-02-25. The problem I'm having here is that when I use the below code, the time seems to be erased.
<?php
$timestamp = '2014-0...
4
Solved
I need to add multiple time values as in Hours:mins, so I use
strtotime($value1) + strtotime($value2)
to add all of them, how do I put them back as hours:mins ?
cant use
date("h:i")
it only...
3
Solved
I've looked at at least 2 dozen topics about this and haven't really found a good answer yet, so I come to you to ask once again for answers regarding the dreaded topic of Repeating Events.
I've g...
Cyst asked 21/3, 2011 at 16:14
2
Solved
I'm using the following code
$t = strtotime('Saturday, 28 Dec, 2013');
echo date('d/m/Y H:i',$t);
// output : 03/01/2015 20:13
$t = strtotime('Wednesday, 01 Jan, 2014');
echo date('d/m/Y H:...
4
Solved
<?php
echo strtotime("2014-01-01 00:00:01")."<hr>";
// output is 1388516401
?>
I am surprised if it can be reverse. I mean can I convert 1388516401 to 2014-01-01 00:00:01.
What I actu...
Fissiparous asked 16/12, 2013 at 17:36
1
Solved
I unfortunately can't use DateTime() as the server this project is on is running PHP v.5.2.
the line in question:
$aptnDate2 = date('Y-m-d', $_POST['nextAppointmentDate']);
throws the followin...
2
Solved
Is there some function timetostr in php that will output today/tomorrow/next sunday/etc. from a given timestamp? So that timetostr(strtotime(x))=x
2
Solved
I have this string: "13/10 15:00" and I would like to convert it to timestamp but when I do this:
$timestamp = strtotime("13/10 15:00");
It returns an empty value.
Prissie asked 13/10, 2013 at 15:26
2
Solved
I have the variable $EDate, I used strtotime function with this variable with different values and the result was as following:
$EDate = 10-21-2013; echo "strtotime($EDate)"; the result = nothing ...
4
Solved
In PHP, how do I get the current time, in UTC, without hard coding knowledge of where my hosting provider is?
For example, I tried the following:
time() + strtotime('January 1, 2000')-strtotime('...
8
Solved
Hay, i have a database holding events. There are 2 fields 'start' and 'end', these contain timestamps. When an admin enters these dates, they only have the ability to set the day,month,year. So we ...
1
Solved
given this kind of date object
date("m/d/Y", strtotime($numerical." ".$day." of ".date("F")))
where it may give a mm/dd/yyyy day that is the "first Monday of August", for instance
how can I deci...
2
Solved
I have a system that accepts user submissions, and upon receiving a submission the system will go through all timeslots to find the appropriate timeslot. The problem is that it needs to be able to ...
© 2022 - 2024 — McMap. All rights reserved.