db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1364776 - /db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
Date Mon, 23 Jul 2012 19:59:16 GMT
Author: tfischer
Date: Mon Jul 23 19:59:16 2012
New Revision: 1364776

URL: http://svn.apache.org/viewvc?rev=1364776&view=rev
Log:
used oracle date format from docs

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java?rev=1364776&r1=1364775&r2=1364776&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
Mon Jul 23 19:59:16 2012
@@ -36,7 +36,13 @@ import org.apache.torque.templates.typem
 public class PlatformOracleImpl extends PlatformDefaultImpl
 {
     /** The date format for formatting database dates. */
-    private static String DATE_FORMAT = "''dd-MM-yyyy HH:mm:ss''";
+    private static String DATE_FORMAT = "''dd-MMM-yy''";
+
+    /** The date format for formatting database dates. */
+    private static String TIME_FORMAT = "''KK:mm:ss a''";
+
+    /** The date format for formatting database dates. */
+    private static String TIMESTAMP_FORMAT = "''dd-MMM-yyyy KK:mm:ss a''";
 
     /**
      * Default constructor.
@@ -145,4 +151,26 @@ public class PlatformOracleImpl extends 
         dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
         return dateFormat.format(date);
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getTimeString(Date date)
+    {
+        SimpleDateFormat dateFormat = new SimpleDateFormat(TIME_FORMAT);
+        dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+        return dateFormat.format(date);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getTimestampString(Date date)
+    {
+        SimpleDateFormat dateFormat = new SimpleDateFormat(TIMESTAMP_FORMAT);
+        dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+        return dateFormat.format(date);
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message