File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
app/src/main/java/fr/free/nrw/commons Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ private void uploadContribution(Contribution contribution) {
286286 contribution .setFilename (canonicalFilename );
287287 contribution .setImageUrl (uploadResult .getImageinfo ().getOriginalUrl ());
288288 contribution .setState (Contribution .STATE_COMPLETED );
289- contribution .setDateUploaded (CommonsDateUtil .getIso8601DateFormatShort ()
289+ contribution .setDateUploaded (CommonsDateUtil .getIso8601DateFormatTimestamp ()
290290 .parse (uploadResult .getImageinfo ().getTimestamp ()));
291291 compositeDisposable .add (contributionDao
292292 .save (contribution )
Original file line number Diff line number Diff line change @@ -13,11 +13,21 @@ public class CommonsDateUtil {
1313
1414 /**
1515 * Gets SimpleDateFormat for short date pattern
16- * @return
16+ * @return simpledateformat
1717 */
1818 public static SimpleDateFormat getIso8601DateFormatShort () {
1919 SimpleDateFormat simpleDateFormat = new SimpleDateFormat ("yyyy-MM-dd" , Locale .ROOT );
2020 simpleDateFormat .setTimeZone (TimeZone .getTimeZone ("UTC" ));
2121 return simpleDateFormat ;
2222 }
23+
24+ /**
25+ * Gets the timestamp pattern for a date
26+ * @return timestamp
27+ */
28+ public static SimpleDateFormat getIso8601DateFormatTimestamp () {
29+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss" , Locale .ROOT );
30+ simpleDateFormat .setTimeZone (TimeZone .getTimeZone ("UTC" ));
31+ return simpleDateFormat ;
32+ }
2333}
You can’t perform that action at this time.
0 commit comments