トップ 差分 一覧 ping ソース 検索 ヘルプ PDF RSS ログイン

Java ビルドタイムスタンプを得る



目次



記事一覧

キーワード

Java ビルドタイムスタンプを得る

[Java]

SimpleDateFormat df = (SimpleDateFormat) SimpleDateFormat.getInstance();
df.applyPattern("yyyyMMddHHmmssSSS");

String timestamp =
df.format(new Date(new File(getClass()
  .getClassLoader()
  .getResource(getClass().getCanonicalName().replace('.', '/') + ".class")
  .toURI()).lastModified()));
return timestamp;



YAGI Hiroto (piroto@a-net.email.ne.jp)
twitter http://twitter.com/pppiroto

Copyright© 矢木 浩人 All Rights Reserved.