org.mailster.util
Class DateUtilities

java.lang.Object
  extended by org.mailster.util.DateUtilities

public class DateUtilities
extends java.lang.Object

---
Mailster (C) 2007-2009 De Oliveira Edouard

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

See  Mailster Web Site
---

MailUtilities.java - Various methods to help in date formatting and handling.

Version:
$Revision: 1.6 $, $Date: 2008/12/06 13:57:17 $
Author:
Edouard De Oliveira

Field Summary
private static java.text.SimpleDateFormat ascTimeFormatter
          ANSI C's asctime() formatter
static java.text.SimpleDateFormat df
          Simple day & hour formatter.
static java.text.SimpleDateFormat gmt
          Simple GMT day & hour formatter.
static java.text.SimpleDateFormat hourDateFormat
          Hour date formatter
static java.text.SimpleDateFormat rfc822DateFormatter
          RFC 822 compliant date formatter
 
Constructor Summary
DateUtilities()
           
 
Method Summary
static java.lang.String formatAsFixedWidthAsctime(java.util.Date d)
          Format date as 24 chars wide ANSI C's asctime().
static boolean isCurrentDay(java.util.Date d)
          Return true if d represents a time value on the current day.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

df

public static final java.text.SimpleDateFormat df
Simple day & hour formatter.


gmt

public static final java.text.SimpleDateFormat gmt
Simple GMT day & hour formatter.


hourDateFormat

public static final java.text.SimpleDateFormat hourDateFormat
Hour date formatter


rfc822DateFormatter

public static final java.text.SimpleDateFormat rfc822DateFormatter
RFC 822 compliant date formatter


ascTimeFormatter

private static final java.text.SimpleDateFormat ascTimeFormatter
ANSI C's asctime() formatter

Constructor Detail

DateUtilities

public DateUtilities()
Method Detail

formatAsFixedWidthAsctime

public static java.lang.String formatAsFixedWidthAsctime(java.util.Date d)
Format date as 24 chars wide ANSI C's asctime().

Parameters:
d - the date to format
Returns:
the formatted date

isCurrentDay

public static boolean isCurrentDay(java.util.Date d)
Return true if d represents a time value on the current day.

Parameters:
d - the date to compare with today
Returns:
boolean true if d is bounded in the current day