Skip to content

Commit

Permalink
Issue #17 - wrong value used for Calendar.get()
Browse files Browse the repository at this point in the history
  • Loading branch information
kwart committed Jul 1, 2013
1 parent d86cc21 commit 6c01826
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/jboss/totp/TOTPMIDlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public void commandAction(Command aCmd, Displayable aDisp) {
} else if (aCmd == cmdAddProfile) {
final Calendar cal = Calendar.getInstance();
// use date-time as generated profile name YYYYMMDD-HHMMSS
final String profileName = cal.get(Calendar.YEAR) + zeroLeftPad(cal.get(Calendar.MONTH + 1), 2)
final String profileName = cal.get(Calendar.YEAR) + zeroLeftPad(cal.get(Calendar.MONTH) + 1, 2)
+ zeroLeftPad(cal.get(Calendar.DAY_OF_MONTH), 2) + "-"
+ zeroLeftPad(cal.get(Calendar.HOUR_OF_DAY), 2) + zeroLeftPad(cal.get(Calendar.MINUTE), 2)
+ zeroLeftPad(cal.get(Calendar.SECOND), 2);
Expand Down

0 comments on commit 6c01826

Please sign in to comment.