<?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: Input variable having YYYMMDD:HHMMSS format to convert to Epoch timestamp in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159328#M495933</link>
    <description>&lt;P&gt;&amp;gt; Your command did not work on HP-UX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "did not work" is not a useful problem description.&amp;nbsp; It does not&lt;BR /&gt;say what you did.&amp;nbsp; It does not say what happened when you did it.&amp;nbsp; As&lt;BR /&gt;usual, showing actual actions (commands) with their actual results&lt;BR /&gt;(error messages, ...) can be more helpful than vague descriptions or&lt;BR /&gt;interpretations.&amp;nbsp; Copy+paste is your friend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _Which_ HP-UX?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uname -a&lt;/P&gt;&lt;P&gt;&amp;gt; [...] I'm not able to say my date as input [...]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "I'm not able" is about as good as "did not work".&amp;nbsp; "There is no&lt;BR /&gt;'date' option to allow me" might be a better description of the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If your HP-supplied "date" program doesn't let you specify an input&lt;BR /&gt;date+time, then you might need to find/provide a program which does.&lt;BR /&gt;For example, GNU "date" (part of GNU Coreutils) seems to have a&lt;BR /&gt;-d/--date option.&amp;nbsp; You might need to translate your date+time&lt;BR /&gt;specification a little to get GNU "date" to parse it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-8.27/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-8.27/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Or find some other, better "date" program.&amp;nbsp; Or write your own program&lt;BR /&gt;to do the job?&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jan 2022 19:27:08 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2022-01-28T19:27:08Z</dc:date>
    <item>
      <title>Input variable having YYYMMDD:HHMMSS format to convert to Epoch timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159286#M495930</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I search everywhere, man pages, google without no success.&amp;nbsp; I need to convert to Epoch Milliseconds an input string stored in a korn shell variable. The format is something like YYYYMMDD:HHMMSS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A="20220124180000"&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;Z=????&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;echo "$Z"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;should return 1643047200&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with the date native function and some intricated syntax but I'm not able to say my date as input is using that format ...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas are very welcome.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Den.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 11:40:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159286#M495930</guid>
      <dc:creator>SwissKnife</dc:creator>
      <dc:date>2022-01-28T11:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Input variable having YYYMMDD:HHMMSS format to convert to Epoch timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159310#M495931</link>
      <description>&lt;P&gt;&amp;gt; I tried with the date native function and some intricated syntax but&lt;BR /&gt;&amp;gt; I'm not able to say my date as input is using that format ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; With my weak psychic powers, I can't see what you tried.&lt;/P&gt;&lt;P&gt;&amp;gt; should return 1643047200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; In which timezone?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I don't have an HP-UX system up at the moment, but, on a handy Mac:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "-f input_fmt new_date" seems to do what "man date" says that it&lt;BR /&gt;will.&lt;/P&gt;&lt;P&gt;$ date -j -f '%Y%m%d%H%M%S' '20220124180000'&lt;BR /&gt;Mon Jan 24 18:00:00 CST 2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "'+%s" as the "[+output_fmt]" option seems to do what "man strftime"&lt;BR /&gt;says that it will.&lt;/P&gt;&lt;P&gt;$ date -j -f '%Y%m%d%H%M%S' '20220124180000' '+%s'&lt;BR /&gt;1643068800&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; UTC:&lt;/P&gt;&lt;P&gt;$ date -j -u -f '%Y%m%d%H%M%S' '20220124180000'&lt;BR /&gt;Mon Jan 24 18:00:00 UTC 2022&lt;/P&gt;&lt;P&gt;$ date -j -u -f '%Y%m%d%H%M%S' '20220124180000' '+%s'&lt;BR /&gt;1643047200&lt;/P&gt;&lt;P&gt;$ TZ=UTC date -j -f '%Y%m%d%H%M%S' '20220124180000'&lt;BR /&gt;Mon Jan 24 18:00:00 UTC 2022&lt;/P&gt;&lt;P&gt;$ TZ=UTC date -j -f '%Y%m%d%H%M%S' '20220124180000' '+%s'&lt;BR /&gt;1643047200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; As usual, many things are possible.&lt;/P&gt;&lt;P&gt;&amp;gt; [...] Milliseconds [...]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "Milli"?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 14:50:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159310#M495931</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2022-01-28T14:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Input variable having YYYMMDD:HHMMSS format to convert to Epoch timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159322#M495932</link>
      <description>&lt;P&gt;Hi Steven,&lt;/P&gt;&lt;P&gt;Thank you but I really need this for HP because options ....&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your command did not work on HP-UX.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Denis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 17:59:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159322#M495932</guid>
      <dc:creator>SwissKnife</dc:creator>
      <dc:date>2022-01-28T17:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Input variable having YYYMMDD:HHMMSS format to convert to Epoch timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159328#M495933</link>
      <description>&lt;P&gt;&amp;gt; Your command did not work on HP-UX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "did not work" is not a useful problem description.&amp;nbsp; It does not&lt;BR /&gt;say what you did.&amp;nbsp; It does not say what happened when you did it.&amp;nbsp; As&lt;BR /&gt;usual, showing actual actions (commands) with their actual results&lt;BR /&gt;(error messages, ...) can be more helpful than vague descriptions or&lt;BR /&gt;interpretations.&amp;nbsp; Copy+paste is your friend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _Which_ HP-UX?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uname -a&lt;/P&gt;&lt;P&gt;&amp;gt; [...] I'm not able to say my date as input [...]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "I'm not able" is about as good as "did not work".&amp;nbsp; "There is no&lt;BR /&gt;'date' option to allow me" might be a better description of the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If your HP-supplied "date" program doesn't let you specify an input&lt;BR /&gt;date+time, then you might need to find/provide a program which does.&lt;BR /&gt;For example, GNU "date" (part of GNU Coreutils) seems to have a&lt;BR /&gt;-d/--date option.&amp;nbsp; You might need to translate your date+time&lt;BR /&gt;specification a little to get GNU "date" to parse it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-8.27/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-8.27/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Or find some other, better "date" program.&amp;nbsp; Or write your own program&lt;BR /&gt;to do the job?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 19:27:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159328#M495933</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2022-01-28T19:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Input variable having YYYMMDD:HHMMSS format to convert to Epoch timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159375#M495934</link>
      <description>&lt;P&gt;Yeah, standard HP-UX date command definitely won't support those options. The coreutils GNU date should though.&lt;/P&gt;&lt;P&gt;For the OP, I'm not clear why you say you want the date output to be "in milliseconds" when the input granularity isn't going below seconds. If you really insist on this output, you may as well work out number of seconds from the epoch and then multiply by 1,000.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 09:38:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/input-variable-having-yyymmdd-hhmmss-format-to-convert-to-epoch/m-p/7159375#M495934</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2022-01-31T09:38:05Z</dc:date>
    </item>
  </channel>
</rss>

