Colls、「DD_MM_YYYY_HH_MI_SS」のようなタイムスタンプを返す sToday 変数を作成するコードがあります。
var today = new Date();
var CurrentDay = today.getDay();
var CurrentMonth = today.getMonth();
var CurrentHours = today.getHours();
var CurrentMin = today.getMinutes();
var CurrentSec = today.getSeconds();
if (CurrentDay < 10)
sToday = "0"+today.getDay().toString();
else
sToday = today.getDay().toString();
if(CurrentMonth<10)
sToday += "_0"+today.getMonth().toString();
else
sToday += "_"+today.getMonth().toString();
sToday += "_"+today.getYear().toString();
if (CurrentHours<10)
sToday += "_0"+today.getHours().toString();
else
sToday += "_"+today.getHours().toString();
if (CurrentMin<10)
sToday += "_0"+today.getMinutes().toString();
else
sToday += "_"+today.getMinutes().toString();
if (CurrentSec<10)
sToday += "_0"+today.getSeconds().toString();
else
sToday += "_"+today.getSeconds().toString();
しかし、13.04.2012 20:20:14 (私の PC 時間) に実行すると、 05_03_2012_20_20_14 を受け取ります。これを修正して 13_04_2012_20_20_14 を受け取る方法は?