Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# The MIT License (MIT)
# Copyright (c) 2016 sharkpp.
# See: https://opensource.org/licenses/mit-license.php
t = Time.at(ARGV[0].to_i);
# http://docs.ruby-lang.org/ja/2.2.0/method/Time/i/strftime.html
[
'%A',
'%a',
'%B',
'%b',
'%C',
'%c',
'%D',
'%d',
'%e',
'%F',
'%H',
'%h',
'%I',
'%j',
'%k',
'%L',
'%l',
'%M',
'%m',
'%n',
'%N',
'%6N',
'%3N',
'%P',
'%p',
'%R',
'%r',
'%S',
'%s',
'%T',
'%t',
'%U',
'%u',
'%v',
'%V',
'%W',
'%w',
'%X',
'%x',
'%Y',
'%y',
'%Z',
'%z',
'%:z',
'%::z',
'%%',
# ほかの言語と同様に出力できるフォーマット
'%-e',
'%-m',
'%-H',
'%-l',
'%FT%T%:z',
'%a, %d %b %Y %T %z',
'%#P',
].each {
|fmt|
print fmt + '@@' + t.strftime(fmt) + '@~';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment