Skip to content

Commit

Permalink
Fix hours formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Aug 6, 2018
1 parent bc4856d commit 3ed2536
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/org/traccar/database/MediaManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private File createFile(String uniqueId, String name) throws IOException {
public String writeFile(String uniqueId, ByteBuf buf, String extension) {
if (path != null) {
int size = buf.readableBytes();
String name = new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + "." + extension;
String name = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + "." + extension;
try (FileOutputStream output = new FileOutputStream(createFile(uniqueId, name));
FileChannel fileChannel = output.getChannel()) {
ByteBuffer byteBuffer = buf.nioBuffer();
Expand Down
2 changes: 1 addition & 1 deletion src/org/traccar/protocol/TelemaxProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected Object decode(
position.setLatitude((Integer.parseInt(readValue(sentence, index, 6), 16) - 5400000) / 30000.0);

if (i == 0 | i == count - 1) {
time = new SimpleDateFormat("yyMMddhhmmss").parse(readValue(sentence, index, 12));
time = new SimpleDateFormat("yyMMddHHmmss").parse(readValue(sentence, index, 12));
position.set(Position.KEY_STATUS, readValue(sentence, index, 8));
} else {
time = new Date(time.getTime() + interval * 1000);
Expand Down
2 changes: 1 addition & 1 deletion test/org/traccar/calendar/CalendarTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void testCalendar() throws IOException, ParserException, ParseException,
"END:VCALENDAR";
Calendar calendar = new Calendar();
calendar.setData(calendarString.getBytes());
DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ssX");
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssX");

Date date = format.parse("2016-12-13 22:59:59+05");
assertTrue(!calendar.checkMoment(date));
Expand Down

0 comments on commit 3ed2536

Please sign in to comment.