I want to set the default clockwise offset (America / Chicago) in the date field. the new Date function has been added to the code and fits it correctly in the HTML file. its date and time display is correct, but I want to set the time zone to the default value for America / chicago. code in the controller:
<script>
mainApp.controller('depositController', ['$scope', '$http', '$filter', function($scope, $http, $filter) {
$scope.myDate = new Date();
}]);
</script>
Run codeHide resulthtml code:
<div class="col-lg-8">
<input id="deposit_date" name="deposit_date"
class="form-control"
type="text"
ng-init="deposit_time=(myDate | date:'HH:mm:ss a' : '-0500')"
ng-model="deposit_time"
readonly="readonly"/>
</div>
Run codeHide resultI want to show the current time America / Chicago (Central Standard Time).
source
share