Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
* Displaying timestamps in UTC
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berger <christian.berger@gu.se>
  • Loading branch information
chrberger committed Sep 5, 2018
1 parent fdd2c7b commit 2a23cea
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ OpenDLV Standard Message Set that are exchanged in a running OpenDLV.io session
(running at 111 in the example), simply run it as follows:

```
docker run --rm --init --net=host --name=opendlv-vehicle-view -v ~/recordings:/opt/vehicle-view/recordings -v /var/run/docker.sock:/var/run/docker.sock -p 8081:8081 chalmersrevere/opendlv-vehicle-view-multi:v0.0.36
docker run --rm --init --net=host --name=opendlv-vehicle-view -v ~/recordings:/opt/vehicle-view/recordings -v /var/run/docker.sock:/var/run/docker.sock -p 8081:8081 chalmersrevere/opendlv-vehicle-view-multi:v0.0.37
```

Now, simply point your web-browser to the IP address and port 8081 where you
Expand Down
32 changes: 16 additions & 16 deletions webapp/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ function processEnvelope(incomingData) {
var currentTimeStamp = data.sampleTimeStamp.seconds * 1000 * 1000 + data.sampleTimeStamp.microseconds;

var date = new Date(currentTimeStamp/1000);
var year = date.getFullYear();
var month = "0" + (date.getMonth()+1);
var day = "0" + date.getDate();
var hours = date.getHours();
var minutes = "0" + date.getMinutes();
var seconds = "0" + date.getSeconds();

var formattedTime = year + '-' + month.substr(-2) + '-' + day.substr(-2) + ' ' + hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
var year = date.getUTCFullYear();
var month = "0" + (date.getUTCMonth()+1);
var day = "0" + date.getUTCDate();
var hours = date.getUTCHours();
var minutes = "0" + date.getUTCMinutes();
var seconds = "0" + date.getUTCSeconds();

var formattedTime = year + '-' + month.substr(-2) + '-' + day.substr(-2) + ' ' + hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2) + " (UTC)";
$("#containerTimeStamp").html(formattedTime);
$("#containerTimeStampUnix").html(Math.floor(currentTimeStamp/1000) + " ms");

Expand Down Expand Up @@ -757,14 +757,14 @@ function setupUI() {
////////////////////////////////////////////////////////////////////////////
function clock() {
var date = new Date(new Date().getTime());
var year = date.getFullYear();
var month = "0" + (date.getMonth()+1);
var day = "0" + date.getDate();
var hours = date.getHours();
var minutes = "0" + date.getMinutes();
var seconds = "0" + date.getSeconds();

var formattedTime = year + '-' + month.substr(-2) + '-' + day.substr(-2) + ' ' + hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
var year = date.getUTCFullYear();
var month = "0" + (date.getUTCMonth()+1);
var day = "0" + date.getUTCDate();
var hours = date.getUTCHours();
var minutes = "0" + date.getUTCMinutes();
var seconds = "0" + date.getUTCSeconds();

var formattedTime = year + '-' + month.substr(-2) + '-' + day.substr(-2) + ' ' + hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2) + " (UTC)";

$('#currentTime').text(formattedTime);
window.setTimeout(clock, 500);
Expand Down
6 changes: 3 additions & 3 deletions webapp/views/main.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@
{{/if}}

<div class="table-responsive">
<div id="currentTime">-</div>
<div id="containerTimeStamp"></div>
<div id="containerTimeStampUnix"></div>
<div id="currentTime" style="font-size:12px;">-</div>
<div id="containerTimeStamp" style="font-size:12px;"></div>
<div id="containerTimeStampUnix" style="font-size:12px;"></div>
<table class="table table-condensed">
<tbody id="table-messages-overview">
</tbody>
Expand Down

0 comments on commit 2a23cea

Please sign in to comment.