我的程序一启动就从服务器取一个日期时间过来,然后把他当作我的信息系统时间,然后在这个系统日期时间的基础上计时,怎么实现?

解决方案 »

  1.   

    程序运行时
    StartTickCount:=GetTickCount;
    这个是1ms加1的。
    只要判断
    if (GetTickCount-StartTickCount)>Time*1000 then //这个是秒,Time*1000*60这个是分钟...
      //DoSomeThing
      

  2.   

    在一个事件中
    str1,str2:string;
    str1:=datetostr(now);
    在另一个“退出”事件中
    str2:=datetostr(now);
    str1与str2 相比较
      

  3.   

    select sysdate from dual;
    然后赋给系统,就行了,
      

  4.   

    GetTickCount,然后用现在的时间减去GETTICKCOUNT*1000.
      

  5.   

    select getdate()
    得到SQL服务器的当前时间
      

  6.   

    借个帖子问一下:我定义了 time1  time2  两个变量 为string 类型.form1 中有两个 DateTimePicker
    如何 在语句中 把  DateTimePicker 选择的 值 赋予time,
    用 time1:= DateTimePicker1.date   不行
      

  7.   

    to sailorsailor(小小流浪者) 
    time1:= datetostr(DateTimePicker1.date )
    借贴子问世不道德的,以后不要这样了