~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/now.cc

  • Committer: Jay Pipes
  • Date: 2009-03-01 03:08:20 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: jpipes@serialcoder-20090301030820-8kxgypvo3yexa9d1
Final removal of timezones

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <drizzled/server_includes.h>
21
21
#include CSTDINT_H
22
22
#include <drizzled/function/time/now.h>
23
 
#include <drizzled/tztime.h>
24
23
#include <drizzled/session.h>
25
24
 
 
25
#include "drizzled/temporal.h"
 
26
 
26
27
String *Item_func_now::val_str(String *)
27
28
{
28
29
  assert(fixed == 1);
54
55
void Item_func_now_local::store_now_in_TIME(DRIZZLE_TIME *now_time)
55
56
{
56
57
  Session *session= current_session;
57
 
  session->variables.time_zone->gmt_sec_to_TIME(now_time,
58
 
                                                (time_t)session->query_start());
 
58
  time_t tmp= session->query_start();
 
59
 
 
60
  (void) cached_temporal.from_time_t(tmp);
 
61
 
 
62
  now_time->year= cached_temporal.years();
 
63
  now_time->month= cached_temporal.months();
 
64
  now_time->day= cached_temporal.days();
 
65
  now_time->hour= cached_temporal.hours();
 
66
  now_time->minute= cached_temporal.minutes();
 
67
  now_time->second= cached_temporal.seconds();
59
68
}
60
69
 
61
70
 
65
74
*/
66
75
void Item_func_now_utc::store_now_in_TIME(DRIZZLE_TIME *now_time)
67
76
{
68
 
  my_tz_UTC->gmt_sec_to_TIME(now_time,
69
 
                             (time_t)(current_session->query_start()));
70
 
  /*
71
 
    We are not flagging this query as using time zone, since it uses fixed
72
 
    UTC-SYSTEM time-zone.
73
 
  */
 
77
  Session *session= current_session;
 
78
  time_t tmp= session->query_start();
 
79
 
 
80
  (void) cached_temporal.from_time_t(tmp);
 
81
 
 
82
  now_time->year= cached_temporal.years();
 
83
  now_time->month= cached_temporal.months();
 
84
  now_time->day= cached_temporal.days();
 
85
  now_time->hour= cached_temporal.hours();
 
86
  now_time->minute= cached_temporal.minutes();
 
87
  now_time->second= cached_temporal.seconds();
 
88
}
 
89
 
 
90
bool Item_func_now::get_temporal(drizzled::DateTime &to)
 
91
{
 
92
  to= cached_temporal;
 
93
  return true;
74
94
}
75
95
 
76
96
bool Item_func_now::get_date(DRIZZLE_TIME *res,