ftime.cpp

来自「数据结构常用算法合集」· C++ 代码 · 共 21 行

CPP
21
字号
//ftime.cpp
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <sys\timeb.h>
#include <conio.h>
/* pacific standard & daylight savings */
char *tzstr = "TZ=PST8PDT";
void main(void)
{
  struct timeb t;
  putenv(tzstr);
  tzset();
  ftime(&t);
  cout<<"自1/1/1970 GMT到"<<ctime(&t.time)<<"的秒数:"<< t.time;
  cout<<"\n千分之秒:"<< t.millitm;
  cout<<"\n当地时间与GMT的差:"<< t.timezone;
  cout<<"\n夏时制(1),无(0):"<< t.dstflag;
  getch();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?