Posted by: sureshamrita | August 30, 2011

Current day and time using Boost

#include <iostream>
#include "boost/date_time/local_time/local_time.hpp"
using namespace std;

int main(){
  boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
  cout << now << endl;
}

Tested with Boost version 1.41

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: