이 난이 웹 응용 프로그램이 그 시간대입니다 서버 (UTC + 05 : 30)에서 호스팅되는asp.net 타임 스탬프 문제
scmd.Connection = scon; //Connection string
SqlParameter p = scmd.CreateParameter();
recodName = txtrecordname.Text; //form field
todaysdate = DateTime.Parse(txtFrom.Text);
DateTime now = DateTime.UtcNow;
AddParameters("@record", recodName); //adding parameter to stored procedure
AddParameters("@date", todaysdate);
AddParameters("@timeinfo", now);
scmd.CommandText = "sp_InsertRecord";
scmd.CommandType = CommandType.StoredProcedure;
scon.Open();
int i=scmd.ExecuteNonQuery();
if (i > 0)
{
result.Text = "Record Inserted RecordName : " + recodName; //Label displaying recordinfo
dateinfo.Text = "Record inserted on (TimeStamp Info) : " + now; //label displaying time info when user inserted record
}
GridView1.DataBind();
asp.net 2.0 웹 양식에서 기록 정보를 저장하는 내 코드 첸나이, 콜카타, 뭄바이, 뉴 델리, 다른 시스템의 사용자가 서부 중앙 아프리카 서부 아프리카 (UTC + 01 : 00) 인 의 응용 프로그램에 액세스 할 수 있습니다. 'Utcnow'로 'datetime now'를 삽입했지만 사용자가 레코드를 볼 때 로컬 날짜 시간 형식에 있어야합니다.
dateinfo.Text = "TimeStamp Info :"+ now; //이 레이블은 현재이 응용 프로그램이 클라이언트 시스템에 현재 시간을 얻을 자바 스크립트 변수에 그것을 넣어 자바 스크립트 도움
감사합니다 답 – user919573