-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added DateTimeHelper to convert current date in ISO format
- Loading branch information
1 parent
f7d0fd5
commit f6d191e
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
app/src/main/java/org/schabi/newpipe/util/DateTimeHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.schabi.newpipe.util; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
public final class DateTimeHelper { | ||
private static final String TAG = DateTimeHelper.class.getSimpleName(); | ||
|
||
private DateTimeHelper() { | ||
//no instance | ||
} | ||
|
||
/** | ||
* @return the current date in ISO format. | ||
*/ | ||
public static String currentDateToIsoDateFormat() { | ||
final LocalDateTime currentDate = LocalDateTime.now(); | ||
return currentDate.format(DateTimeFormatter.ISO_DATE_TIME); | ||
} | ||
} |