From 42b47b3f2fa7829403a5e07a28b08ed0e0bd6bcc Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 9 Dec 2014 15:51:18 -0800 Subject: [PATCH] urb.util.toDate --- main/lib/urb.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main/lib/urb.js b/main/lib/urb.js index a35c28926..794e99edc 100644 --- a/main/lib/urb.js +++ b/main/lib/urb.js @@ -88,3 +88,16 @@ window.urb.unsubscribe = function(params,cb) { delete $this.cabs[$this.gsig(params)] }) } + +window.urb.util = { + toDate: function (dat){ + var mils = Math.floor((0x10000 * dat.getUTCMilliseconds()) / 1000).toString(16) + return '~' + dat.getUTCFullYear() + + '.' + (dat.getUTCMonth() + 1) + + '.' + dat.getUTCDate() + + '..' + dat.getUTCHours() + + '.' + dat.getUTCMinutes() + + '.' + dat.getUTCSeconds() + + '..' + ('0000' + mils).substr(-4, 4) + } +}