Skip to content
Snippets Groups Projects
Commit 7d3fe254 authored by kwang-bsn's avatar kwang-bsn
Browse files

BSC-3132 Adjust the date time format

parent ee7e37e4
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,9 @@
package net.floodlightcontroller.core;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import net.floodlightcontroller.core.IFloodlightProviderService.Role;
......@@ -64,7 +66,11 @@ public class RoleInfo {
}
@JsonProperty(value="change-date-time")
public String getRoleChangeDateTime() {
return roleChangeDateTime == null ? "" : roleChangeDateTime.toString();
SimpleDateFormat formatter =
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
return roleChangeDateTime == null ?
"" : formatter.format(roleChangeDateTime);
}
}
\ No newline at end of file
......@@ -184,7 +184,7 @@ public class Controller implements IFloodlightProviderService,
// The current role of the controller.
// If the controller isn't configured to support roles, then this is null.
protected Role role;
protected String lastRoleChangeDescription = "Inital role set during startup.";
protected String lastRoleChangeDescription = "Controller startup.";
protected Date roleChangeDateTime = new Date();
// This is the role of the controller based on HARoleChange notifications
// we have sent. I.e., this field reflects the last role notification
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment