Am 09.08.2013 21:18, schrieb Olaf Radicke:

...
> Okay, and how can i cast from tntdb::Datetime to cxxtools::DateTime and back?
> It's that the way it is?
>
> [...]
>          tntdb::Datetime dbdt = row[3].getDatetime() ;
>          cxxtools::DateTime cxxdt(
>              dbdt.getYear(),
>              dbdt.getMonth(),
>              dbdt.getDay(),
>              dbdt.getHour(),
>              dbdt.getMinute(),
>              dbdt.getSecond()
>          );
>          feed.setCreateTime( cxxdt );
> [...]
>
> Olaf
>
> -------------------|-------------------|-------------------|-------------------|
use the #include <tntdb/cxxtools/datetime.h>. Then go this way:

     cxxtools::DateTime dt;
     row[3].get(dt);

I always suggest to use tntdb::Row::get() instead of getInt, getString, 
getDatetime, ...

The other way around to write a cxxtools::DateTime into the database:

     tntdb::Statement stmt = conn.prepare("...");
     cxxtools::Datetime dt = ...;
     stmt.set("datecol", dt);

Note that tntdb::Row::get and tntdb::Statement::set can work with own 
types if you provide suitable operators for those.

Tommi

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to