<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Diptesh,<br>
      <br>
      Good catch - I almost forgot about that function :).<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
</pre>
    <div class="moz-cite-prefix">On 11/14/2017 04:47 PM, Dipteshkumar
      Patel wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAD4_Da1oQqFT4kEvhj8nn_XkSHePoaW-J-6MKDFcCaAdhE7ofg@mail.gmail.com">
      <div dir="ltr">hello all,
        <div><br>
        </div>
        <div>I got the option to get right time stamp both in seconds
          and microseconds and that is </div>
        <h4
style="margin-top:1em;margin-bottom:0.6em;color:rgb(24,86,98);font-family:"Trebuchet
          MS",sans-serif,Verdana,Arial;font-size:1.07em">get_timestamp(sec_avp,usec_avp);</h4>
        <div>which uses gettimeofday() system call internally.</div>
        <div><br>
        </div>
        <div>refer following link</div>
        <div><a
            href="https://www.opensips.org/Documentation/Script-CoreFunctions-2-3"
            moz-do-not-send="true">https://www.opensips.org/Documentation/Script-CoreFunctions-2-3</a><br>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr"><b>Diptesh Patel</b>
              <div>Jr. Software Developer </div>
              <div>Ecosmob Technologies Ltd</div>
              <div>Ahmedabad</div>
              <div>Mo:<b>+919898962659</b></div>
            </div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">On Wed, Nov 1, 2017 at 3:59 PM,
          Bogdan-Andrei Iancu <span dir="ltr"><<a
              href="mailto:bogdan@opensips.org" target="_blank"
              moz-do-not-send="true">bogdan@opensips.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> <tt>Hi Diptesh,<br>
                <br>
                Unfortunately the docs are a bit misleading - the
                supported format for the $time() var is given by "man
                strftime" - and strftime has no support for time units
                smaller than the second. This is why the %N is not
                evaluated.<br>
                <br>
                Regards,<br>
              </tt><span class="">
                <pre class="m_2603253958268781316moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="m_2603253958268781316moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a>
</pre>
              </span>
              <div>
                <div class="h5">
                  <div class="m_2603253958268781316moz-cite-prefix">On
                    10/31/2017 03:32 PM, Dipteshkumar Patel wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Hello sir,
                      <div><br>
                      </div>
                      <div>Thanks for your prompt reply</div>
                      <div><br>
                      </div>
                      <div>I used <b>$time(+%s%N)</b> but it uses only
                        one format and give the result "<b>+1509451841%N</b>"
                        but i want to whole time stamp.</div>
                      <div><br>
                      </div>
                      <div>This works fine from command line using  <b>#time
                          +%s%N.</b></div>
                      <div><b><br>
                        </b></div>
                      <div><b><br>
                        </b></div>
                      <div><br>
                      </div>
                    </div>
                    <div class="gmail_extra"><br clear="all">
                      <div>
                        <div
                          class="m_2603253958268781316gmail_signature"
                          data-smartmail="gmail_signature">
                          <div dir="ltr"><b>Diptesh Patel</b>
                            <div>Jr. Software Developer </div>
                            <div>Ecosmob Technologies Ltd</div>
                            <div>Ahmedabad</div>
                            <div>Mo:<b>+919898962659</b></div>
                          </div>
                        </div>
                      </div>
                      <br>
                      <div class="gmail_quote">On Tue, Oct 31, 2017 at
                        5:12 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a
                            href="mailto:bogdan@opensips.org"
                            target="_blank" moz-do-not-send="true">bogdan@opensips.org</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000"> <tt>Hi,<br>
                              <br>
                              Have you looked at the $time(format)
                              script variable:<br>
                              <br>
                              <a
                                class="m_2603253958268781316m_1216156772636087379moz-txt-link-freetext"
href="http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc87"
                                target="_blank" moz-do-not-send="true">http://www.opensips.org/Docume<wbr>ntation/Script-CoreVar-2-3#<wbr>toc87</a><br>
                              <br>
                              You can take the all the time fields at
                              once, and use a transformation to split
                              them if you need the fields in separate
                              variables.<br>
                              <br>
                              Regards,<br>
                            </tt>
                            <pre class="m_2603253958268781316m_1216156772636087379moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="m_2603253958268781316m_1216156772636087379moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a>
</pre>
                            <div>
                              <div class="m_2603253958268781316h5">
                                <div
                                  class="m_2603253958268781316m_1216156772636087379moz-cite-prefix">On
                                  10/31/2017 10:36 AM, Dipteshkumar
                                  Patel wrote:<br>
                                </div>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div class="m_2603253958268781316h5">
                                  <div dir="ltr">Dear sir,
                                    <div><br>
                                    </div>
                                    <div>I am using Opensips version
                                      2.3.1</div>
                                    <div><br>
                                    </div>
                                    <div>I am using $Ts and $Tsm for
                                      time stamp for CDR but the
                                      microsecond time stamp is not same
                                      as system time stamp. To resolve
                                      the issue i am using exec() to get
                                      the system time but i takes so
                                      much time (nearly 5ms ) whenever
                                      so many calls concurrently running
                                      on server(We need exact time
                                      because it will affect the call
                                      duration).</div>
                                    <div> </div>
                                    <div>Can you please suggest me
                                      solution for the issue ?</div>
                                    <div><br>
                                    </div>
                                    <div>Thanks</div>
                                    <div><br>
                                    </div>
                                    <div>
                                      <div>
                                        <div
                                          class="m_2603253958268781316m_1216156772636087379gmail_signature"
data-smartmail="gmail_signature">
                                          <div dir="ltr"><b>Diptesh
                                              Patel</b>
                                            <div>Jr. Software Developer </div>
                                            <div>Ecosmob Technologies
                                              Ltd</div>
                                            <div>Ahmedabad</div>
                                            <div>Mo:<b>+919898962659</b></div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <br>
                                  <fieldset
                                    class="m_2603253958268781316m_1216156772636087379mimeAttachmentHeader"></fieldset>
                                  <br>
                                </div>
                              </div>
                              <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_2603253958268781316m_1216156772636087379moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_2603253958268781316m_1216156772636087379moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
                            </blockquote>
                            <br>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>