Attachment 'utime2ymd.txt'

Download

   1 #!/bin/sh
   2 usage="Usage: utime2ymd <timestamp> [local|gmt]
   3 \n\nConvert 10-digit Unix timestamp to yyyymmdd.hhmmss format
   4 \n use local time zone (default) or UTC/GMT"
   5 [ $1 ] || { echo -e $usage; exit 1 ; }
   6 
   7 unixtime=`echo $1|cut -c -10`
   8 
   9 if [ $2 ] 
  10 then qual2=`echo $2|awk '{print tolower($1)}'`
  11     if [ "$qual2" = "gmt" ] 
  12     then thetime=`perl -e "print scalar(gmtime($unixtime))"`
  13     fi
  14 else
  15     qual2="local"
  16     thetime=`perl -e "print scalar(localtime($unixtime))"`
  17 fi 
  18 
  19 YYYYMM=`echo $thetime | awk '{print $5 $2}' \
  20     | sed 's/Jan/01/;s/Feb/02/;s/Mar/03/;s/Apr/04/;s/May/05/;s/Jun/06/;
  21            s/Jul/07/;s/Aug/08/;s/Sep/09/;s/Oct/10/;s/Nov/11/;s/Dec/12/'`
  22 
  23 DD=`echo $thetime | awk '{printf("%02d",$3)}'`
  24 
  25 hhmmss=`echo $thetime | awk '{print $4}' | sed 's/://g'`
  26 
  27 echo "$YYYYMM$DD.$hhmmss $qual2"

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2005-03-22 06:25:53, 42.5 KB) [[attachment:DummyWebsitePerformance.JPG]]
  • [get | view] (2007-07-20 13:59:01, 9.5 KB) [[attachment:JMeterSummary.java]]
  • [get | view] (2007-07-20 13:59:37, 1.3 KB) [[attachment:JMeterSummaryOutput.txt]]
  • [get | view] (2008-04-21 05:39:22, 7.4 KB) [[attachment:cm_AdressService_throughput.png]]
  • [get | view] (2008-04-21 05:39:44, 6.2 KB) [[attachment:cm_AdressService_users.png]]
  • [get | view] (2008-04-21 05:39:54, 4.7 KB) [[attachment:cm_ChartStacked.png]]
  • [get | view] (2008-04-21 05:40:03, 5.7 KB) [[attachment:cm_ChartStackedPct.png]]
  • [get | view] (2008-04-21 06:27:06, 7.7 KB) [[attachment:cm_entire_throughput.png]]
  • [get | view] (2008-04-21 06:26:45, 6.0 KB) [[attachment:cm_entire_users.png]]
  • [get | view] (2008-04-21 07:01:30, 6.8 KB) [[attachment:cm_entire_users_range.png]]
  • [get | view] (2008-04-21 07:02:51, 6.7 KB) [[attachment:cm_entire_users_stddev.png]]
  • [get | view] (2008-04-21 05:40:12, 83.3 KB) [[attachment:cm_jmeter.png]]
  • [get | view] (2010-03-26 02:44:39, 16.8 KB) [[attachment:jmetergraph.pl]]
  • [get | view] (2010-11-05 01:17:23, 17.7 KB) [[attachment:jmetergraphhtml.pl]]
  • [get | view] (2006-11-28 08:20:58, 1.0 KB) [[attachment:jmxparse.sh.txt]]
  • [get | view] (2009-02-17 04:11:21, 1.4 KB) [[attachment:jtlmin.sh.txt]]
  • [get | view] (2009-07-30 18:15:56, 0.9 KB) [[attachment:jtlsummary.sh]]
  • [get | view] (2006-11-28 06:05:53, 2.1 KB) [[attachment:jtltotals.sh.txt]]
  • [get | view] (2011-02-15 21:16:39, 243.2 KB) [[attachment:package.zip]]
  • [get | view] (2009-02-17 05:30:26, 23.4 KB) [[attachment:perf-excel2.png]]
  • [get | view] (2005-06-28 10:09:05, 33.6 KB) [[attachment:scripts_jmeter.zip]]
  • [get | view] (2006-11-28 05:41:12, 4.9 KB) [[attachment:throughput-graph.png]]
  • [get | view] (2006-11-28 07:00:28, 0.8 KB) [[attachment:utime2ymd.txt]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.