logo       

roller/src/org/roller/util DateUtil.java,1.4,1.5 Utilities.java,1.15,1.16: msg#00124

Subject: roller/src/org/roller/util DateUtil.java,1.4,1.5 Utilities.java,1.15,1.16
Update of /cvsroot/roller/roller/src/org/roller/util
In directory sc8-pr-cvs1:/tmp/cvs-serv24457/src/org/roller/util

Modified Files:
        DateUtil.java Utilities.java 
Log Message:
ISO-8601 date in RSS channel header allows us to validate again as RSS 2.0

Index: DateUtil.java
===================================================================
RCS file: /cvsroot/roller/roller/src/org/roller/util/DateUtil.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DateUtil.java       5 Feb 2003 17:40:17 -0000       1.4
--- DateUtil.java       17 Feb 2003 15:44:53 -0000      1.5
***************
*** 23,26 ****
--- 23,29 ----
          new SimpleDateFormat("yyyyMMdd");
  
+     private static SimpleDateFormat mFormatIso8601 = 
+         new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+ 
      //-----------------------------------------------------------------------
      /**
***************
*** 275,278 ****
--- 278,296 ----
      {
          return DateUtil.format(date, mFormat8chars);
+     }
+ 
+     //-----------------------------------------------------------------------
+     // This is a hack, but it seems to work
+     public static String formatIso8601(Date date)
+     {
+         // Add a colon 2 chars before the end of the string
+         // to make it a valid ISO-8601 date.
+          
+         String str = DateUtil.format(date,mFormatIso8601);
+         StringBuffer sb = new StringBuffer();
+         sb.append( str.substring(0,str.length()-2) );
+         sb.append( ":" );
+         sb.append( str.substring(str.length()-2) );
+         return sb.toString();
      }
  

Index: Utilities.java
===================================================================
RCS file: /cvsroot/roller/roller/src/org/roller/util/Utilities.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Utilities.java      8 Feb 2003 05:40:32 -0000       1.15
--- Utilities.java      17 Feb 2003 15:44:53 -0000      1.16
***************
*** 9,12 ****
--- 9,13 ----
  import java.io.InputStream;
  import java.io.OutputStream;
+ import java.util.Date;
  import java.util.NoSuchElementException;
  import java.util.StringTokenizer;
***************
*** 98,101 ****
--- 99,103 ----
      }
  
+     //------------------------------------------------------------------------
      /**
       * Escape, but do not replace HTML.
***************
*** 107,110 ****
--- 109,113 ----
      }
  
+     //------------------------------------------------------------------------
      /**
       * Escape, but do not replace HTML.
***************
*** 126,129 ****
--- 129,142 ----
      }
  
+     //------------------------------------------------------------------------
+     /**
+      * Format date in ISO-8601 format.
+      */
+     public static String formatIso8601Date(Date d)
+     {
+         return DateUtil.formatIso8601(d);
+     }
+ 
+     //------------------------------------------------------------------------
      /** Run both removeHTML and escapeHTML on a string.
       * @param s String to be run through removeHTML and escapeHTML.




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe