Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.221.707 Times

Log::Log4perl::DateFormat 1.11

  Date Added: January 25, 2010  |  Visits: 1.140

Log::Log4perl::DateFormat

Report Broken Link
Printer Friendly Version


Product Homepage
Download (94 downloads)



Log::Log4perl::DateFormat is a Log4perl advanced date formatter helper class. SYNOPSIS use Log::Log4perl::DateFormat; my $format = Log::Log4perl::DateFormat->new("HH:mm:ss,SSS"); # Simple time, resolution in seconds my $time = time(); print $format->format($time), "n"; # => "17:02:39,000" # Advanced time, resultion in milliseconds use Time::HiRes; my ($secs, $msecs) = Time::HiRes::gettimeofday(); print $format->format($secs, $msecs), "n"; # => "17:02:39,959" Log::Log4perl::DateFormat is a low-level helper class for the advanced date formatting functions in Log::Log4perl::Layout::PatternLayout. Unless youre writing your own Layout class like Log::Log4perl::Layout::PatternLayout, theres probably not much use for you to read this. Log::Log4perl::DateFormat is a formatter which allows dates to be formatted according to the log4j spec on http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html which allows the following placeholders to be recognized and processed: Symbol Meaning Presentation Example ------ ------- ------------ ------- G era designator (Text) AD y year (Number) 1996 M month in year (Text & Number) July & 07 d day in month (Number) 10 h hour in am/pm (1~12) (Number) 12 H hour in day (0~23) (Number) 0 m minute in hour (Number) 30 s second in minute (Number) 55 S millisecond (Number) 978 E day in week (Text) Tuesday D day in year (Number) 189 F day of week in month (Number) 2 (2nd Wed in July) w week in year (Number) 27 W week in month (Number) 2 a am/pm marker (Text) PM k hour in day (1~24) (Number) 24 K hour in am/pm (0~11) (Number) 0 z time zone (Text) Pacific Standard Time Z RFC 822 time zone (Text) -0800 escape for text (Delimiter) single quote (Literal) For example, if you want to format the current Unix time in "MM/dd HH:mm" format, all you have to do is this: use Log::Log4perl::DateFormat; my $format = Log::Log4perl::DateFormat->new("MM/dd HH:mm"); my $time = time(); print $format->format($time), "n"; While the new() method is expensive, because it parses the format strings and sets up all kinds of structures behind the scenes, followup calls to format() are fast, because DateFormat will just call localtime() and sprintf() once to return the formatted date/time string. So, typically, you would initialize the formatter once and then reuse it over and over again to display all kinds of time values. Also, for your convenience, the following predefined formats are available, just as outlined in the log4j spec: Format Equivalent Example ABSOLUTE "HH:mm:ss,SSS" "15:49:37,459" DATE "dd MMM yyyy HH:mm:ss,SSS" "06 Nov 1994 15:49:37,459" ISO8601 "yyyy-MM-dd HH:mm:ss,SSS" "1999-11-27 15:49:37,459" APACHE "[EEE MMM dd HH:mm:ss yyyy]" "[Wed Mar 16 15:49:37 2005]" So, instead of passing Log::Log4perl::DateFormat->new("HH:mm:ss,SSS"); you could just as well say Log::Log4perl::DateFormat->new("ABSOLUTE"); and get the same result later on..

Requirements: No special requirements
Platforms: Linux
Keyword: Advanced Date Dateformat Format Hh Libraries Mm Number Programming Sss Text Time
Users rating: 0/10

License: Freeware Size: 225.28 KB
USER REVIEWS
More Reviews or Write Review


LOG::LOG4PERL::DATEFORMAT RELATED
Screen Savers  -  3D BallClock ScreenSaver 1.0
This screensaver shows on your screen 3D clock (time format - HH:MM:SS) rotating, digits are constructed from small balls. You may choose color of digits (balls), speed and rotation axis.
244 KB  
Development Tools  -  Advanced Modern Control System Theory and Design 1.0
This book is designed for an advanced course and is a companion volume to the introductory text, Modern Control System Theory and Design, 2e. In addition, it can serve as a text for practicing control system engineers who need to learn more...
757.76 KB  
Modules  -  Casecode table 6.x-1.0-beta1
Two fields are displayed by the widget instead of one.The values of the two fields will be merged to value1|value2 where value1 must be numeric and value2 must not be empty.If the widget is used for a multiple field the final list of values will...
10 KB  
Development Editors  -  MAX's HTML Beauty++ 2004 2.0
MAX's HTML Beauty++ 2004 is an advanced HTML editor that can edit as many files at a time as you want. Built-In Image Browser Viewer with GIF Optimize function and ability to convert images to WBMP image format which is used by WAP-compatible...
1.73 MB  
Libraries  -  Pentium 1.5 Build 9431
Pentium works on Intel Pentium class and AMD CPUs to determine the CPUID information such as the vendor, brand/model, step, model, instruction set family, cpu serial number, and the RDTSC Time stamp register for high resolution timing measured in...
 
Libraries  -  Netiden ActiveX 1
Net-Iden automatically dials your application user's telephone number at the same time that the customer is performing a transaction on your application. Once the Activex places the call, your customer is required to enter a PIN number in order to...
68 KB  
Server Tools  -  SharePoint Search and Replace 1.0.16
The SharePoint Search and Replace package provides a tool that replaces hardcoded strings in SharePoint lists, document libraries, web part properties and text-based documents. SharePoint administrators will find this useful during SharePoint...
266 KB  
Programming  -  devkitPro 1.5.7
This project is for homebrew console development tools based on the gnu compiler collection with additional tools and libraries to aid programming each supported console. The windows variants are built with MinGW.
444.26 KB  
Communication Tools  -  Net Clients .NET 1.0.1
Client libraries written in C# for text-based internet protocols (so far including NNTP and Dict). These libraries are designed to reflect the RFCs of their respective protocols. With the release of the MS WCF, this project is effectively obsolete.
113.49 KB  
Libraries  -  Time::Format 1.02
Time::Format is a Perl module for easy-to-use date/time formatting. SYNOPSIS use Time::Format qw(%time %strftime %manip); $time{$format} $time{$format, $unixtime} print "Today is $time{yyyy/mm/dd}n"; print "Yesterday was...
38.91 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB