libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit d530bd9c9526e130561bb346a280215b38a89f13
parent 3db2403f55914a2251afbd48abae95c161a16ee5
Author: MS <ms@taler.net>
Date:   Mon, 25 May 2020 17:20:56 +0200

parse dashed date

Diffstat:
Mutil/src/test/kotlin/TimeTest.kt | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/util/src/test/kotlin/TimeTest.kt b/util/src/test/kotlin/TimeTest.kt @@ -1,6 +1,7 @@ import org.junit.Test import java.time.* import java.time.format.DateTimeFormatter +import java.time.temporal.TemporalAccessor class TimeTest { @Test @@ -25,9 +26,19 @@ class TimeTest { val dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME return dtf.format(dateTime) } - val str = formatDashed(LocalDateTime.now()) + val str = formatDashed(LocalDateTime.now()) println(str) val str0 = formatZonedWithOffset(LocalDateTime.now().atZone(ZoneId.systemDefault())) println(str0) } + + @Test + fun parseDashedDate() { + fun parse(dashedDate: String): LocalDate { + val dtf = DateTimeFormatter.ISO_LOCAL_DATE + return LocalDate.parse(dashedDate, dtf) + } + val ret = parse("1970-01-01") + println(ret.toString()) + } } \ No newline at end of file