Formattare una data – XBMC-Italia.it
[sourcecode language=”javascript”] <script type=”text/javascript”> <!– function DateFmt() { this.dateMarkers = { d:[‘getDate’,function(v) { return (“0″+v).substr(-2,2)}], m:[‘getMonth’,function(v) { return (“0″+v).substr(-2,2)}], n:[‘getMonth’,function(v) { var mthNames = [“Gen”,”Feb”,”Mar”,”Apr”,”Mag”,”Giu”,”Lug”,”Ago”,”Set”,”Ott”,”Nov”,”Dic”]; return mthNames[v]; }], w:[‘getDay’,function(v) { var dayNames = [“Dom”,”Lun”,”Mar”,”Mer”,”Gio”,”Ven”,”Sab”]; return dayNames[v]; }], y:[‘getFullYear’], H:[‘getHours’,function(v) { return (“0″+v).substr(-2,2)}], M:[‘getMinutes’,function(v) { return (“0″+v).substr(-2,2)}], S:[‘getSeconds’,function(v) { return (“0″+v).substr(-2,2)}], i:[‘toISOString’,null] }; this.format = function(date, […]
