~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/microtime.cc

  • Committer: Lee Bieber
  • Date: 2011-04-12 21:52:42 UTC
  • mfrom: (2269.1.11 session2)
  • mto: This revision was merged to the branch mainline in revision 2276.
  • Revision ID: kalebral@gmail.com-20110412215242-el4vajlkxxckxi3u
Merge Olaf - Refactor Session

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <drizzled/tztime.h>
26
26
#include <drizzled/table.h>
27
27
#include <drizzled/session.h>
 
28
#include <drizzled/session/times.h>
28
29
#include <drizzled/current_session.h>
29
 
 
30
 
#include <math.h>
31
 
 
 
30
#include <drizzled/temporal.h>
 
31
#include <cmath>
32
32
#include <sstream>
33
 
 
34
33
#include <boost/date_time/posix_time/posix_time.hpp>
35
34
 
36
 
#include <drizzled/temporal.h>
37
 
 
38
 
namespace drizzled
39
 
{
40
 
 
41
 
namespace field
42
 
{
 
35
 
 
36
namespace drizzled {
 
37
namespace field {
43
38
 
44
39
static boost::posix_time::ptime _epoch(boost::gregorian::date(1970, 1, 1));
45
40
 
287
282
  Session *session= getTable() ? getTable()->in_use : current_session;
288
283
 
289
284
  type::Time::usec_t fractional_seconds= 0;
290
 
  uint64_t epoch_seconds= session->getCurrentTimestampEpoch(fractional_seconds);
 
285
  uint64_t epoch_seconds= session->times.getCurrentTimestampEpoch(fractional_seconds);
291
286
 
292
287
  set_notnull();
293
288
  pack_num(epoch_seconds);