3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AIXではdateコマンドでは自由に日付が操作できない

Last updated at Posted at 2016-08-01

#概要
 AIXではInfocenterに記載の通り-dオプションがない
 よって、翌日や前日、ある指定した日からのニッス計算が実施できない
 https://www.ibm.com/support/knowledgecenter/ja/ssw_aix_53/com.ibm.aix.cmds/doc/aixcmds2/date.htm
 
 
#解決策
 perlを利用する

 perl -e 'my $delay = 3600;my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time + $delay);printf "%02d%02d%02d%02d\n",$mon,$mday,$hour,$min'

 
#詳細
 AIXはデフォルトでperlがインストールされるため、perlは全環境で利用できる。
 perlのlocaltime関数を利用することで現在時刻を取得できるため、そこに秒数を指定することで、時刻を調整できる。
 

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?