<?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: perl localtime to get format in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031634#M94987</link>
    <description>First time I am not using perl, and has saved me code.&lt;BR /&gt;&lt;BR /&gt;chomp( my $dispdate = `date +%Y-%m-%dT%X.000` );</description>
    <pubDate>Tue, 06 Mar 2007 16:35:41 GMT</pubDate>
    <dc:creator>Ratzie</dc:creator>
    <dc:date>2007-03-06T16:35:41Z</dc:date>
    <item>
      <title>perl localtime to get format</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031631#M94984</link>
      <description>I would like to use the perl localtime to display the format&lt;BR /&gt;YYMMDDHHMMSS</description>
      <pubDate>Fri, 02 Mar 2007 17:22:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031631#M94984</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2007-03-02T17:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: perl localtime to get format</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031632#M94985</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Use the POSIX::strftime module.  THe directives are the same as the libc ones.&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX=strftime -e 'print strftime("%Y%m%d%H%M%S\n",localtime)'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Mar 2007 17:32:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031632#M94985</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-02T17:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: perl localtime to get format</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031633#M94986</link>
      <description>#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sub do_1_timestamp&lt;BR /&gt;{&lt;BR /&gt;  use integer;&lt;BR /&gt;&lt;BR /&gt;  my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($_[0]);&lt;BR /&gt;  my $s_tmp = sprintf("%02d%02d%02d%02d%02d%02d",&lt;BR /&gt;                      ($year + 1900) % 100,$mon + 1,$mday,$hour,$min,$sec);&lt;BR /&gt;  return($s_tmp);&lt;BR /&gt;} # do_1_timestamp&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;print "Current Time is ",do_1_timestamp(time()),"\n";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Mar 2007 17:33:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031633#M94986</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-03-02T17:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: perl localtime to get format</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031634#M94987</link>
      <description>First time I am not using perl, and has saved me code.&lt;BR /&gt;&lt;BR /&gt;chomp( my $dispdate = `date +%Y-%m-%dT%X.000` );</description>
      <pubDate>Tue, 06 Mar 2007 16:35:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031634#M94987</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2007-03-06T16:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: perl localtime to get format</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031635#M94988</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;The downside of your own solution is that you are invoking the shell to run the 'date' command.  This adds the creation of an unnecessary process to do what Perl can do directly. &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 06 Mar 2007 16:46:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031635#M94988</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-06T16:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: perl localtime to get format</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031636#M94989</link>
      <description>... and to add injury to insult, your use of the external date command means that your can only format the current date and time rather than any date and time such as the modification time of a file, the date 3 hours from now, ... which would all simply be a different argument to the function I gave you.</description>
      <pubDate>Tue, 06 Mar 2007 16:58:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031636#M94989</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-03-06T16:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: perl localtime to get format</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031637#M94990</link>
      <description>OK OK, Perl still rules.&lt;BR /&gt;I know I was going to open up a can of worms with this one.</description>
      <pubDate>Tue, 06 Mar 2007 17:03:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-localtime-to-get-format/m-p/5031637#M94990</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2007-03-06T17:03:02Z</dc:date>
    </item>
  </channel>
</rss>

