Permalink
Browse files

fix generation of date

  • Loading branch information...
1 parent 5180de1 commit b8fb292c7ce91a732e2711ef3c595013499e5851 @mschoch mschoch committed Mar 26, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/com/couchbase/grocerysync/GroceryItemUtils.java
View
7 src/com/couchbase/grocerysync/GroceryItemUtils.java
@@ -1,5 +1,6 @@
package com.couchbase.grocerysync;
+import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.UUID;
@@ -8,10 +9,10 @@
import org.codehaus.jackson.node.JsonNodeFactory;
import org.codehaus.jackson.node.ObjectNode;
-import android.text.format.DateFormat;
-
public class GroceryItemUtils {
+ public static SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+
public static void toggleCheck(JsonNode item) {
ObjectNode itemObject = (ObjectNode)item;
JsonNode checkNode = item.get("check");
@@ -32,7 +33,7 @@ public static JsonNode createWithText(String text) {
UUID uuid = UUID.randomUUID();
Calendar calendar = GregorianCalendar.getInstance();
long currentTime = calendar.getTimeInMillis();
- String currentTimeString = DateFormat.format("EEEE-MM-dd'T'HH:mm:ss.SSS'Z'", calendar).toString();
+ String currentTimeString = dateFormatter.format(calendar.getTime());
String id = currentTime + "-" + uuid.toString();

0 comments on commit b8fb292

Please sign in to comment.