zoukankan      html  css  js  c++  java
  • C++ 获取系统时间

    #include <iostream>
    #include <time.h>
    using namespace std;
    
    int main(int arg,char* args[])
    {
    time_t now2;
    time(&now2);
    struct tm* fmt2=localtime(&now2);.
    
    cout << "小时:\t" << fmt2->tm_hour << endl;
    cout << "分钟:\t" << fmt2->tm_min << endl;
    cout << "秒数:\t" << fmt2->tm_sec << endl;
    cout << "秒数:\t" << fmt2->tm_sec << endl;
    cout << "年是:\t" << fmt2->tm_year +1900<< endl;
    cout << "月是:\t" << fmt2->tm_mon+1<< endl;
    cout << "日是:\t" << fmt2->tm_mday<< endl;
    return 0;
    }
    

      

  • 相关阅读:
    json
    封装PDO
    PDO
    jquery练习
    jquery包
    jquery
    租房子 多条件查询
    查询
    新闻修改处理页面
    新闻添加数据
  • 原文地址:https://www.cnblogs.com/mrye/p/2667080.html
Copyright © 2011-2022 走看看