X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=importPicture%2Ftest%2Fosm%2Fjp%2Fgpx%2FElementMapTRKPTTest.java;h=90d4a1ff19667093e19b86019b831072a00f753a;hb=8eb8b44955398dc58e8abd3eba7a810ee47be9ce;hp=982a02045195bd9145db1b584fbb7d1416d4bc3a;hpb=b3153b74e69481b99fd8a5e7e7265bb2e090cc1b;p=importpicture%2Fimportpicture.git diff --git a/importPicture/test/osm/jp/gpx/ElementMapTRKPTTest.java b/importPicture/test/osm/jp/gpx/ElementMapTRKPTTest.java index 982a020..90d4a1f 100644 --- a/importPicture/test/osm/jp/gpx/ElementMapTRKPTTest.java +++ b/importPicture/test/osm/jp/gpx/ElementMapTRKPTTest.java @@ -4,6 +4,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.*; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; @@ -226,4 +227,17 @@ public class ElementMapTRKPTTest { assertThat(ret, is(nullValue())); } } + + public static class タイムスタンプの書式 { + @Test + public void EXIF時刻書式テスト() throws Exception { + String dateTimeOriginal = "2017:06:30 09:59:59"; + Date time = ImportPicture.toEXIFDate(dateTimeOriginal); + assertThat(ImportPicture.toEXIFString(time), is("2017:06:30 09:59:59")); + assertThat(ImportPicture.toUTCString(time), is("2017-06-30T09:59:59Z")); + DateFormat dfUTC = new SimpleDateFormat(ImportPicture.TIME_FORMAT_STRING); + assertThat(dfUTC.format(time), is("2017-06-30T18:59:59Z")); + } + + } }