Skip to main content
gamedev.net
🔒 Locked

boost date_time

Started by _the_phantom_ Nov 25, 2003 at 10:29 PM 6 replies 750+ views
Original Post
_the_phantom_
_the_phantom_
I've had some 'minor' problems using this. I've tried to do a very simply function of getting the time now and shoving it into an std::string.
#include "stdafx.h"

#include <boost/date_time/posix_time/posix_time.hpp>

namespace utility
{

	// Gets the current date

	std::string getDate();
	std::string getTime();
	std::string getDateTime()
	{
		return boost::posix_time::to_simple_string(boost::posix_time::second_clock::universal_time());	// get the time now into a string

	}
}
If I try it that way VC7.1 (VS.Net03) throw this error at me :
g:\Programming\SDKs\boost_1_30_0\boost\lexical_cast.hpp(147): error C2679: binary '<<' : no operator found which takes a right-hand operand of type 
'const boost::token_iterator_generator::value_type' (or there is no acceptable conversion)
        with
        [
            TokenizerFunc=boost::char_delimiters_separator,
            Iterator=std::basic_string,std::allocator>::const_iterator,
            Type=std::string
        ]
   
however if i #define BOOST_NO_STRINGSTREAM before i import the lib. thus disabling stringstream it compiles fine. (commenting out the header include also makes the problem go away) Anyone else had experiance of this problem or is it something i've done to cause it? The regesion testing shows VC7.1 as having no problems with the date_time stuff so its a tad confusing :o [edited by - _the_phantom_ on November 25, 2003 11:29:46 PM] [edited by - _the_phantom_ on November 25, 2003 11:30:48 PM]
_the_phantom_
_the_phantom_
just the one bump, i''ll leave it to die after this
_the_phantom_
_the_phantom_
while compatiblilty isnt an issue with this program it might be in another, so i figured it was worth while looking into how to use the system while i had the time to do it with this project.
Therefore I would submit that i''ve saved time in the long run by learning to use something i''ll probably have use for again, therefore it wasnt a waste of time

However, neither replies answered my query, so i''ll continue with the define and if no one else has any comments this thread will die
Shannon Barber
Shannon Barber
I''ve asked Jeff Garland abot this issue prior and it was the first he''d heard of it. I have the same problem, but I had to write my own formatter any way so I didn''t persue it. If you have time, try to create a minimal program that demostrates the problem.

I also wrote a microsecond clock implementation for Win32, if you have need for that.
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
_the_phantom_
_the_phantom_
yeah, my next step was to email the guy who made it (or someone connected at least) saying what i''d found, just wanted to make sure i wasnt being dumb

All i''m after is the time and date for a log file so microseconds are a bit OTT, but ta anyways

I''ll try and get that small program done and contact the relivent person about it tonite (time willing)
Qw3r7yU10p!
Qw3r7yU10p!
there are lots of support options without having to email the author as a first port of call

mailing lists

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.