Skip to content

Commit 70d00d0

Browse files
new DTU.parse() - returns Date
1 parent ab666b2 commit 70d00d0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

utils/src/main/java/com/streamliners/utils/DateTimeUtils.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ object DateTimeUtils {
5757
)
5858
}
5959

60+
fun parse(format: Format, time: String, lenient: Boolean = false): Date {
61+
return parseFormattedTime(format, time, lenient).time
62+
}
63+
6064
fun parseFormattedTime(format: Format, time: String, lenient: Boolean = false): Calendar {
6165
val date = SimpleDateFormat(format.pattern, Locale.getDefault())
6266
.run { isLenient = lenient; this }

0 commit comments

Comments
 (0)