0

OracleDBのタイムスタンプ変数を使用する列を持つテーブルがあります。JQueryを使用してSQLクエリから変数「スケジュール時間」を定義し、条件を実行する方法がわかりません。基本的に、列のタイムスタンプをシステム時刻と比較し、行の背景色を返します。

ps。私のテーブルはaspxページ内にあります

// declaring the time

var currentTime = new Date();
var scheduledTime = "not sure how to declare the variable from my dynamic table"

// variables for the table
var rows = document.getElementById('ewGrid').getElementbyTagName('tr');

 // style class
.rowRed {background-color:red; color:white;}
.rowYellow {background-color:red; color white} 


$('tr').each(function() {
// if value is a number and less then zero
if (currentTime - scheduledTime) >15mins<=30mins ) {
    tr = $(this).parent();
    tr.addClass("rowRed");
 }

 });

助けてくれてありがとう

4

1 に答える 1

0

unix タイムスタンプには秒単位の精度があるため、ミリ秒に変換して Date コンストラクターに渡します。

var scheduledTime = new Date(unixtimestamp*1000)
// where unixtimestamp is the timestamp you get from the database 
于 2013-01-08T17:22:43.800 に答える