<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Info on timestamp in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056808#M64828</link>
    <description>Can u tel me in shell scripting pls</description>
    <pubDate>Mon, 20 Aug 2007 05:32:24 GMT</pubDate>
    <dc:creator>Karthik_sg</dc:creator>
    <dc:date>2007-08-20T05:32:24Z</dc:date>
    <item>
      <title>Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056806#M64826</link>
      <description>hi guys,&lt;BR /&gt;        Can any body tell me how to subtract the current timestamp - 3minutes.&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Mon, 20 Aug 2007 05:02:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056806#M64826</guid>
      <dc:creator>Karthik_sg</dc:creator>
      <dc:date>2007-08-20T05:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056807#M64827</link>
      <description>perl -e 'print scalar localtime(time-180)'&lt;BR /&gt;&lt;BR /&gt;...where "180" is the seconds for three minutes.&lt;BR /&gt;&lt;BR /&gt;Yours&lt;BR /&gt;Danny Petterson</description>
      <pubDate>Mon, 20 Aug 2007 05:11:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056807#M64827</guid>
      <dc:creator>Danny Petterson - DK</dc:creator>
      <dc:date>2007-08-20T05:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056808#M64828</link>
      <description>Can u tel me in shell scripting pls</description>
      <pubDate>Mon, 20 Aug 2007 05:32:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056808#M64828</guid>
      <dc:creator>Karthik_sg</dc:creator>
      <dc:date>2007-08-20T05:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056809#M64829</link>
      <description>And the timestamp is in this format.&lt;BR /&gt;2007-07-19 14:29:33&lt;BR /&gt;Now How to subtract the 3 minutes tht i had askd earlier.</description>
      <pubDate>Mon, 20 Aug 2007 06:37:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056809#M64829</guid>
      <dc:creator>Karthik_sg</dc:creator>
      <dc:date>2007-08-20T06:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056810#M64830</link>
      <description>Hey&lt;BR /&gt;&lt;BR /&gt;I suggest you to use perl:&lt;BR /&gt;perl -e '@x=localtime(time-3*60);printf"%4d-%02d-%02d %02d:%02d:%02d\n",$x[5]+1900,$x[4]+1,$x[3],$x[2],$x[1],$x[0]'&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;p.s. I have assigned points to   4  of   36  responses --&amp;gt; don't forget to assign points, also in your other threads!</description>
      <pubDate>Mon, 20 Aug 2007 07:19:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056810#M64830</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-08-20T07:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056811#M64831</link>
      <description>In raw shell, not easily from a timestamp.&lt;BR /&gt;&lt;BR /&gt;You can use 'date -d "&lt;TIMESTAMP&gt;"', but you can't do further modifications to it.&lt;BR /&gt;&lt;BR /&gt;If you just wanted the current time 3 minutes ago, you could have used 'date -d "3 minutes ago"', but this doesn't work stacked onto another -d.&lt;BR /&gt;&lt;BR /&gt;Unfortunately, 'date -d' doesn't understand the Epoch form of time, i.e. 'date -d 1184819193'.  If it did, you could stack some date's, but it doesn't.&lt;BR /&gt;&lt;BR /&gt;So, use the funky perl method.  You can $() it in a subshell *shrug*.&lt;/TIMESTAMP&gt;</description>
      <pubDate>Mon, 20 Aug 2007 08:52:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056811#M64831</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-08-20T08:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056813#M64833</link>
      <description>And can u pls explain this&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;perl -e '@x=localtime(time-3*60);printf"%4d-%02d-%02d %02d:%02d:%02d\n",$x[5]+1900,$x[4]+1,$x[3],$x[2],$x[1],$x[0]'&lt;BR /&gt;&lt;BR /&gt;with respect to&lt;BR /&gt;&lt;BR /&gt;2007-07-19 14:29:33&lt;BR /&gt;&lt;BR /&gt; i have assigned points and thanks.</description>
      <pubDate>Thu, 23 Aug 2007 01:28:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056813#M64833</guid>
      <dc:creator>Karthik_sg</dc:creator>
      <dc:date>2007-08-23T01:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056814#M64834</link>
      <description>Wait, I'm confused.  I think I mis-read your original post.&lt;BR /&gt;&lt;BR /&gt;Do you want to take 3 minutes away from the current time, or from a pre-defined time?&lt;BR /&gt;&lt;BR /&gt;If from the current time, you can use either the perl method above, or:&lt;BR /&gt;&lt;BR /&gt;date -d '3 minutes ago' +'%Y-%m-%d %H:%M:%S'&lt;BR /&gt;&lt;BR /&gt;But this all depends on how and where you want to use it.&lt;BR /&gt;&lt;BR /&gt;For instance, if you're wanting to do this calculation to use in an SQL query, it's easier to do it *IN* SQL.  The MySQL syntax would be simply:&lt;BR /&gt;&lt;BR /&gt;SELECT DATE_SUB(NOW(), INTERVAL 3 MINUTE);&lt;BR /&gt;&lt;BR /&gt;In other SQL's, there can be slightly different syntax.&lt;BR /&gt;&lt;BR /&gt;So, can you tell us where you want to use this?  Perhaps then we can give you a better answer.</description>
      <pubDate>Thu, 23 Aug 2007 01:37:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056814#M64834</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-08-23T01:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056815#M64835</link>
      <description>I am using it in mysql.the difference is used in a script where we generate alerts.i.e, if the time is same for the last 3 minutes then we are suppose to notify via the script.thanks,i wil try try this and let u know</description>
      <pubDate>Thu, 23 Aug 2007 03:35:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056815#M64835</guid>
      <dc:creator>Karthik_sg</dc:creator>
      <dc:date>2007-08-23T03:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056816#M64836</link>
      <description>hi The query u had sent doesnt work in mysql .u have any idea how it goes in mysql&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Aug 2007 05:09:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056816#M64836</guid>
      <dc:creator>Karthik_sg</dc:creator>
      <dc:date>2007-08-23T05:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Info on timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056817#M64837</link>
      <description>.. How can you not get that to work?&lt;BR /&gt;&lt;BR /&gt;SELECT data_field FROM table WHERE time_field &amp;gt; DATE_SUB(NOW(), INTERVAL 3 MINUTE);&lt;BR /&gt;&lt;BR /&gt;This assumes that the 'time_field' is in a date/time/datetime/timestamp format.&lt;BR /&gt;&lt;BR /&gt;If it's in epoch time (a flat integer), then use 'UNIX_TIMESTAMP() - 180' instead.</description>
      <pubDate>Thu, 23 Aug 2007 16:58:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/info-on-timestamp/m-p/4056817#M64837</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-08-23T16:58:03Z</dc:date>
    </item>
  </channel>
</rss>

