My Professional Profile

I am Johnson Augustine Sr.Software Engineer and System Architect. I have 10 Yrs of hands on expertise in ASP.net MVC 5 , Angular 5 , C# MVC Razor, WPF MVVM , Android , IOS Swift 3 , IOS11 MSSQL,MySQL Database,,PHP,C/C++/Visual C++/G++/QT++,Com,DirectX,Open CV,EMGU CV , embedded System Development , [Raspberry PI]. ,html,Javascript,Jquery,Ajax.CSS , Networking ,Cyber security, Ethical Hacking You can see my professional profile at http://linkedin.com/in/johnsontaugustine Email : johnsonaugustine@live.com

Thursday, 25 April 2013

Date and Time in C++/Visual C++/Linux C++ GC++,C


void Get_Date_AndTime()
{
std::string line,m_strDate,m_strTime,m_ImagePathToDB;
int day,month,year,hour,min,sec;
// Getting time current time
time_t theTime = time(NULL);
struct tm *aTime = localtime(&theTime);
day = aTime->tm_mday;
month = aTime->tm_mon + 1; // Month is 0 - 11, add 1 to get a jan-dec 1-12 concept
year = aTime->tm_year + 1900; // Year is # years since 1900
hour=aTime->tm_hour;
min=aTime->tm_min;
sec=aTime->tm_sec;

m_strDate="";
m_strTime="";
m_strDate=m_strDate+ConvertINTToString(year)+"-"+ConvertINTToString(month)+"-"+ConvertINTToString(day);
m_strTime=m_strTime+ConvertINTToString(hour)+":"+ConvertINTToString(min)+":"+ConvertINTToString(sec);
}

// Format YYYY:MM:DD  TIME - HH:MM:SEC

No comments:

Post a Comment

Note: only a member of this blog may post a comment.