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...
Hathorn asked 14/10, 2015 at 15:27

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 ...
Emarginate asked 9/10, 2015 at 14:31

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...
Capriccioso asked 23/9, 2015 at 12:1

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...
Nonagenarian asked 21/8, 2015 at 4:29

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 ...
Nadaba asked 31/7, 2015 at 16:11

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...
Henebry asked 16/7, 2010 at 14:49

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...
Brazilein asked 17/4, 2015 at 19:9

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...
Builtup asked 11/10, 2011 at 11:0

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 ...
Coorg asked 29/1, 2015 at 15:30

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...
Glendon asked 17/12, 2014 at 14:35

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...
Kaolack asked 27/10, 2014 at 12:20

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"); ...
Wonderland asked 13/7, 2013 at 4:45

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...
Fry asked 26/2, 2014 at 23:38

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...
Kao asked 4/2, 2014 at 18:22

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:...
Quadrennial asked 3/1, 2014 at 12:26

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...
Antipodal asked 13/12, 2013 at 19:29

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
Sarena asked 25/12, 2011 at 13:27

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 ...
Filamentous asked 3/10, 2013 at 16:56

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('...
Kaiser asked 23/9, 2009 at 4:14

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 ...
Spacious asked 2/11, 2010 at 16:27

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...
Dortch asked 26/6, 2013 at 19:55

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 ...
Trenton asked 17/6, 2013 at 8:45

© 2022 - 2024 — McMap. All rights reserved.