Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@



package org.cipres.treebase.auxdata;

import java.text.ParseException;
Expand All @@ -13,6 +12,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;

import org.cipres.treebase.domain.TBPersistable;
import org.cipres.treebase.domain.matrix.Matrix;
Expand Down Expand Up @@ -372,6 +372,7 @@ public Date getCreationDate() {
}
try {
SimpleDateFormat ds = new SimpleDateFormat("M/d/yy KK:mm:ss");
ds.setTimeZone(TimeZone.getTimeZone("EST"));
return ds.parse(creationDateString);
} catch (ParseException e) { /* ignore it */ }
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;

import junit.framework.TestCase;

Expand Down Expand Up @@ -156,10 +159,9 @@ public void testGetCreationHistorySection() {

public void testGetCreationDate() {
Date d = aux.getCreationDate();
// DateFormat df = new SimpleDateFormat("dd MMM yyyy hh:mm:ss zzz");
// df.setTimeZone(TimeZone.getTimeZone("GMT"));
// assertEquals("28 Jan 1996 19:14:16 GMT", df.format(d));
assertEquals("28 Jan 1996 19:14:16 GMT", d.toGMTString());
DateFormat df = new SimpleDateFormat("dd MMM yyyy HH:mm:ss zzz");
df.setTimeZone(TimeZone.getTimeZone("GMT"));
assertEquals("28 Jan 1996 19:14:16 GMT", df.format(d));
}

public void testSkip() {
Expand Down
Loading