【Java开源代码栏目提醒】:网学会员--在 Java开源代码编辑为广大网友搜集整理了:Timestamp.java绩等信息,祝愿广大网友取得需要的信息,参考学习。
/**
* The contents of this file are subject to the ClickBlocks Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.clickblocks.org
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied, including, but not limited to, the implied warranties of
* merchantability, fitness for a particular purpose and
* non-infringement. See the License for the specific language
* governing rights and limitations under the License.
*
* ClickBlocks, the ClickBlocks logo and combinations thereof are
* trademarks of ClickBlocks, LLC in the United States and other
* countries.
*
* The Initial Developer of the Original Code is ClickBlocks, LLC.
* Portions created by ClickBlocks, LLC are Copyright (C) 2000.
* All Rights Reserved.
*
*/
/*
* $Log: Timestamp.java,v $
* Revision 1.1 2001/04/06 22:18:24 mgrand
* Added to repository.
*
* Revision 1.1.1.1 2001/02/10 19:35:47 mgrand
* Establish stand-alone clickblocks CVS repository.
*
* Revision 1.4 2000/12/06 18:29:04 mark
* Spell checked.
*
* Revision 1.3 2000/11/16 19:03:20 mark
* Cleaned up comments
*
* Revision 1.2 2000/10/11 00:31:06 mark
* new stuff
*
*/
// - - - - - - - - - - - - - -
package org.clickblocks.util;
// - - - - - - - - - - - - - -
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Timestamp
*
* Utility class to provide formatted timestamp strings for logging, etc.
*
* @author Stuart Baron
* @Version 0.820
*/
public class Timestamp
{
/**
* Utility Date Formatter
*/
private static SimpleDateFormat dateFormat = new SimpleDateFormat( "MM/dd/yyyy hh:mm.a" );
/**
* Returns a formatted timestamp as a String.
*
* @return a formatted timestamp string
*/
public static String getTimeStamp()
{
try
{
return( dateFormat.format( new Date() ).toString() );
}
catch( Throwable t )
{
return( "" );
}
}
}
// LocalWords: java
上一篇:
TimeSizeRollingFileAppender.java
下一篇:
:现在要收费的搜猫9.0正式版现在免费分享给大家