File tree 3 files changed +27
-3
lines changed
src/main/java/com/amit/utilities 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ android {
10
10
defaultConfig {
11
11
minSdkVersion 19
12
12
targetSdkVersion 28
13
- versionCode 33 // this indicates the number of releases of library
14
- versionName " 1.3.5 " // this indicates the current version of library
13
+ versionCode 34 // this indicates the number of releases of library
14
+ versionName " 1.3.6 " // this indicates the current version of library
15
15
}
16
16
17
17
buildTypes {
Original file line number Diff line number Diff line change 13
13
* <p>
14
14
* this class will help in formatting date and time
15
15
**/
16
- @ SuppressWarnings ("unused, deprecation" )
16
+ @ SuppressWarnings ({ "unused, deprecation" , "WeakerAccess" } )
17
17
public class DateTimeUtils
18
18
{
19
19
private static final String TAG = DateTimeUtils .class .getSimpleName ();
20
20
21
+ /**
22
+ * 2018 November 03 - Saturday - 12:00 PM
23
+ * get current date time method
24
+ *
25
+ * this method will current date time in string type
26
+ *
27
+ * @param inDateTimeFormat - Pass the date or date time format you
28
+ * want to get date or date time in format
29
+ * Ex: dd-MM-yyyy or dd-MM-yyyy hh:mm
30
+ *
31
+ * @return - date or date time returned
32
+ **/
33
+ private static String getCurrentDateTime (String inDateTimeFormat )
34
+ {
35
+ if (inDateTimeFormat != null && inDateTimeFormat .length () != 0 )
36
+ {
37
+ String dateTime = java .text .DateFormat .getDateTimeInstance ().format (new Date ());
38
+ return DateTimeUtils .formatDateTime (dateTime , inDateTimeFormat );
39
+ }
40
+
41
+ Log .e (TAG , "getCurrentDateTime: given date format is not valid" );
42
+ return "" ;
43
+ }
44
+
21
45
/**
22
46
* format date time method
23
47
* <p>
You can’t perform that action at this time.
0 commit comments