Initialise bs-timepicker with utc

I'm using the following code to create a timepicker (source: http://mgcrea.github.io/angular-strap/#/datepicker#timepickers). But I can't initialize the time. It keeps initializing local time while I want another. What am I doing wrong?

html

<input id="txtContrStartTimeTime" name="txtStartTimeTime" type="text"
       class="form-control"
       ng-model="time"
       bs-timepicker data-show-meridian="false" data-minute-step="1"
        >

JS

$scope.time = new Date(546541685565); //somewhere in 1989
    console.log("time first", $scope.time);

Answers


I had to disable a default time being set and change $scope.time to "hh:mm" format.

 data-default-time="false"

Try:

$scope.time = new Date(new Date(546541685565).setMinutes(0));

As done in the plunkr of the widget: http://plnkr.co/edit/?p=preview

EDIT: Actually it should work without setMiutes(0). Are you sure, you're setting the right model?


Need Your Help

gae-sessions equivalent for Python 2.7

python google-app-engine session python-2.7

I wonder wether there's a port for gae-sessions (https://github.com/dound/gae-sessions) for the "new" Python (2.7) on AppEngine.

Eclipse package needed to run successfully

java eclipse package

I'm just beginning at running simple Java programs with Eclipse. The udemy.com tutorial I'm working from starts each program with public class followed by the main method. I get an error in main me...