Fork me on GitHub

Changeset 465 in svn


Ignore:
Timestamp:
Jul 10, 2009, 3:50:06 PM (15 years ago)
Author:
Xavier Rouby
Message:

new function outputting the current time and date

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/interface/SmearUtil.h

    r455 r465  
    4040
    4141#include <vector>
     42#include <string>
    4243#include "TLorentzVector.h"
    4344
     
    293294
    294295void print_header();
     296string get_time_date();
    295297#endif
  • trunk/src/SmearUtil.cc

    r454 r465  
    16491649
    16501650}
     1651
     1652string get_time_date() {
     1653  time_t rawtime;
     1654  struct tm * timeinfo;
     1655
     1656  time ( &rawtime );
     1657  timeinfo = localtime ( &rawtime );
     1658 
     1659  char temp[100];
     1660  sprintf(temp,"%i/%i/%i %i:%i:%i",timeinfo->tm_mday,timeinfo->tm_mon+1,timeinfo->tm_year+1900,timeinfo->tm_hour,timeinfo->tm_min,timeinfo->tm_sec);
     1661  string tempstring(temp);
     1662  return tempstring;
     1663}
     1664
Note: See TracChangeset for help on using the changeset viewer.