I have for example:  $first = '2014-05-18 12:00:00'; $last = '2014-05-18 13:30:00';   and i would like calculate interval in 30 minutes for these dates. For this example interval = 3.  Other example:  $first = '2014-05-18 11:00:00'; $last = '2014-05-18 14:00:00';   interval = 6;  How is the best way for this in PHP?
I have two dates of the form:  Start Date: 2007-03-24  End Date: 2009-06-26   Now I need to find the difference between these two in the following form:  2 years, 3 months and 2 days   How can I do this in PHP?
Why can't we see infrared light? PHPUnit skips all tests Given a prime $p$ and number $a$, how do I find the smallest $n$ such that $n^a\equiv 1 \pmod p$? Is there a non trial-and-error method?  Edit: obviously removing $n=1$! Does opacity:0 have exactly the same effect as visibility:hidden Zero integral of measurable $f$ on every interval implies $f=0$? Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a Borel measurable function, such that $\displaystyle \int_{a}^{b}f(x)dx=0$ for every $a&lt;b$ in $\mathbb{R}.$ Is it true that $f(x)=0$ for every $x\in \mathbb{R}$?  Comments: the starting point of this is to prove that the (Borel measurable) density function $f$ (if exists) of a symmetric random variable $X$ (meaning that $X,~-X$ have common cdf's) is even. If my question has a positive answer, it follows easily.   Thanks a lot for any comments! How to place a .png texture with transparency over a material Moving /var, /home to separate partition I am attempting to move some folders (such as /var and /home) to a separate partition after reading this guide:    I was able to move one folder successfully following guide.  However, it doesn't seem to work for multiple folders, and all my folders are dumped into the partition without proper folders.  I would like to mount /var, /home, and /tmp onto the separate partition; can someone guide me on this? How can I generate and print a 32 bit sequence of 0s and 1s in Qiskit or IBM Q experience quantum lab using quantum random number generator implementation? To EAV or not to EAV? Hello I am taking a Discrete Mathematics course and having some trouble with this question about sets:  Under what conditions is $A- B = B- A$  Diagram:   Diagram:   Maybe I'm understanding incorrectly, but how can A-B and B-A be equal if they contain elements that are not in each other? Bug in time of expiring bounty Noticed this many times but was too lazy to post.  So I see a message in my inbox that bounty is completed and now in grace period, however its title says that "bounty expiring soon"    Wonderful (not wonderful of course). I click it, and... guess what?    Ok. So 49 mins left. But the main problem is that time traveling is . (if it is not, please forbid it). Advice/literature on combining items with different response scales into composite scales? Let's say I have some self-report items measured on a 5-point Likert scale (Strongly Disagree to Strongly Agree) and other items measured on a 4-point Likert scale (Never, Rarely, Sometimes, Often). Can anyone point me to literature (or practical advice) on combining these items into a composite scale? Let's assume for the sake of argument that we have some empirical evidence that items should be combined.  Some ideas:  1. Sum raw scores  Pro: Easy  Con: Max responses on the 5-point scale (originally 4's) drive up the total scale score more than max responses on the 4-point scale (originally 3's).  2. Rescale and sum  Put all of the items on a 0-1 scale and sum. So the 4-point items (0,1,2,3) would be multiplied by (4/3)/4 and the 5-point items (0,1,2,3,4) would be multiplied by 1/4, resulting in possible values of (0,.33,.66,1) and (0,.25,.50,.75,1), respectively. This way max responses on the 5-point scale (originally 4's) would not drive up the total scale score more than max responses on the 4-point scale (originally 3's).   Pro: Items would have equal weighting. (could be a con, depending on your perspective).  Con: Ignores differences in variability between items on different metrics?   3. Standardize and sum  A related approach would be to standardize all of the items (z score) and then sum.  Pro: Addresses differences in variability between items on different metrics  Con: Total scale score becomes less interpretable and sample-specific. The latter makes it hard to benchmark as a measure to be used in other settings/other samples.  4. PCA or other data reduction   4a. EFA to get factor loadings. Multiply scaled items by factor loadings.  4b. PCA to get score of first principal component.  Pro: Items weighted by influence.  Con: Same as #2. EFA-derived scores could vary a lot depending on rotation/extraction choices. Some would not advise on ordinal data.    Overall: I like #2 because it seems easier to compare results across different samples. Thoughts? Alternative ideas or concerns about the ideas presented? Encountered an error while updating through Synaptic Manager. Subsequent updates gave the error at the bottom of the output. I'm a noob so any help is appreciated.  al@al:~$ sudo apt-get -f upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following NEW packages will be installed:   libjack-jackd2-0:i386 The following packages have been kept back:   linux-headers-generic skype 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. Need to get 0 B/202 kB of archives. After this operation, 493 kB of additional disk space will be used. Do you want to continue [Y/n]? y (Reading database ... 310056 files and directories currently installed.) Unpacking libjack-jackd2-0:i386 (from .../libjack-jackd2-0_1.9.8~dfsg.2-1precise1_i386.deb) ... dpkg: error processing /var/cache/apt/archives/libjack-jackd2-0_1.9.8~dfsg.2-1precise1_i386.deb (--unpack):  './usr/share/doc/libjack-jackd2-0/buildinfo.gz' is different from the same file on the system dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing:  /var/cache/apt/archives/libjack-jackd2-0_1.9.8~dfsg.2-1precise1_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Why is my USB drive showing corrupted data when plugged as an internal SATA drive? Can I see which seats are available on a British Airways flight before I book? How to search based on part of file name in Google Drive I'd like to be able to find all files in my Google drive that contain the string "_INSTRUCTION_" in the file name. Is there a way to do this?  EDIT 1: When I search for "RMA2013", I should get a dropdown with several options. As you can see, there are several Word and .pdf files with the phrase "RMA2013". Still I get no dropdown help:   And even if I click the search button, I get nothing: This question led to a new package:   I would like to display the ORCID id in an author list in an IEEEtran pdf, like that:  Is there a standard way to include it in an IEEEtran article with PdfLaTeX? I used two approaches from , but I failed. One is to insert the ORCID icon in the author list. I used the blow code: \author{Ali Al-Obaidi \href{https://orcid.org/0000-0000-0000-0000}{\includegraphics[scale=1]{figures/orcid_16x16.png}}}  where orchid_16x16.png is provided in the link . But the result is that the icon is not clear enough, even I replaced it with a different size. The other approach is to use the  package, like that: \usepackage{academicons} \definecolor{orcidlogocol}{HTML}{A6CE39} \author{AAA \href{https://orcid.org/0000-0000-0000-0000}{\textcolor{orcidlogocol}{\aiOrcid}}}  However, the result is like that:  And I also got two errors: &quot;Latex Error: Encoding scheme 'TU' unknown&quot; and &quot;Bad character code (59865)&quot;. In the latest academicons.sty (see ), academicons use the font TU. However, it seems that the compiler PdfLateX cannot support this font. Thus, is there anyone that knows a standard way to include it in an IEEEtran article with PdfLaTeX? Please help me. I got a problem while making a model of a product. I have tried a lot even seen lots of tutorial but did not get the thing that i want. I am using Blender 9.92 and I am just a beginner I got my hands on Blender 7-8 days ago. I've just basic knowledge about I am trying to model a product &quot;Mattress Topper&quot;   This is the exact look of the product, Help me how i can model this product and render realistic images. How to apply multiple styles in WPF In WPF, how would I apply multiple styles to a FrameworkElement?  For instance, I have a control which already has a style.  I also have a separate style which I would like to add to it without blowing away the first one.  The styles have different TargetTypes, so I can't just extend one with the other. How to convert Bedrock texture pack to Java Edition Minecraft