Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to find nearest timestamp by comparing two array
    primarykey
    data
    text
    <p>I have two arrays lets say <code>$data['Occur']</code> and <code>$data['Reset']</code></p> <p><code>$data['Occur']</code> is an array consist of timestamps of some event occurrence and </p> <p><code>$data['Reset']</code> is an array consist of timestamps of <strong>reset</strong> same occurrence</p> <p>What i have to do is find respective <strong>reset</strong> timestamp for event occur.</p> <p>for example:</p> <p>if event occur at "<strong>2013-10-01 00:50:27</strong>" and it is in array <strong>$data['Occur']</strong> then reset timestamp of that event will be just greater timestamp <strong>2013-10-01 00:53:27</strong>.</p> <p>I have to maintain an array from this which will look like:</p> <p>$array[0]['occur']='2013-10-01 00:50:27';</p> <p>$array[0]['reset']='2013-10-01 00:53:27';(respective reset timestamp of 2013-10-01 00:50:27)</p> <p>$array[1]['occur']='2013-10-01 00:55:11';</p> <p>$array[1]['reset']='2013-10-01 00:57:17';(respective reset timestamp of 2013-10-01 00:55:11)</p> <p>On the basis of 'occur' timestamp , i have to find just greater 'reset' timestamp for every time stamp value of $data['Occur'] array.</p> <p>$data['Occur'] array will looks like:</p> <pre><code>[Occur] =&gt; Array ( [0] =&gt; Array ( [Occur_Date_Time] =&gt; 2013-10-01 00:50:27 ) [1] =&gt; Array ( [Occur_Date_Time] =&gt; 2013-09-01 00:52:01 ) [2] =&gt; Array ( [Occur_Date_Time] =&gt; 2013-08-01 00:07:48 ) [3] =&gt; Array ( [Occur_Date_Time] =&gt; 2013-07-01 00:06:59 ) [4] =&gt; Array ( [Occur_Date_Time] =&gt; 2013-06-18 10:04:16 ) [5] =&gt; Array ( [Occur_Date_Time] =&gt; 2013-06-17 11:40:50 ) ) **and** [reset] =&gt; Array ( [0] =&gt; Array ( [reset_Date_Time] =&gt; 2014-04-01 00:03:34 ) [1] =&gt; Array ( [reset_Date_Time] =&gt; 2013-09-01 01:09:21 ) [2] =&gt; Array ( [reset_Date_Time] =&gt; 2013-09-01 00:00:34 ) [3] =&gt; Array ( [reset_Date_Time] =&gt; 2013-07-01 00:16:14 ) [4] =&gt; Array ( [reset_Date_Time] =&gt; 2013-06-18 11:05:28 ) [5] =&gt; Array ( [reset_Date_Time] =&gt; 2013-06-17 12:56:58 ) ) </code></pre> <p>above array may will have random timestamp , so i cant matched them sequentially. i have to match all event occur and reset timestamps . how can i get this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload