1<!DOCTYPE html> 2<!-- 3Copyright (c) 2015 The Chromium Authors. All rights reserved. 4Use of this source code is governed by a BSD-style license that can be 5found in the LICENSE file. 6--> 7 8<link rel="import" href="/base/units/time.html"> 9 10<script> 11'use strict'; 12 13tr.exportTo('tr.b.units', function() { 14 /** 15 * Float wrapper, representing a time stamp, capable of pretty-printing. 16 */ 17 function TimeStamp(timestamp) { 18 this.timestamp = timestamp; 19 }; 20 21 TimeStamp.prototype = { 22 toString: function() { 23 return TimeStamp.format(this.timestamp); 24 } 25 }; 26 27 TimeStamp.format = function(timestamp) { 28 return tr.b.units.Time.currentDisplayUnit.format(timestamp); 29 }; 30 31 return { 32 TimeStamp: TimeStamp 33 }; 34}); 35</script> 36