~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/time.cc

  • Committer: Jay Pipes
  • Date: 2009-02-28 17:49:35 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 908.
  • Revision ID: jpipes@serialcoder-20090228174935-yfgsw7m0n9gx8pka
Merging in old r903 temporal changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
  return;
186
186
}
187
187
 
188
 
        /* Functions to handle periods */
189
 
 
190
 
uint32_t convert_period_to_month(uint32_t period)
191
 
{
192
 
  uint32_t a,b;
193
 
  if (period == 0)
194
 
    return 0L;
195
 
  if ((a=period/100) < YY_PART_YEAR)
196
 
    a+=2000;
197
 
  else if (a < 100)
198
 
    a+=1900;
199
 
  b=period%100;
200
 
  return a*12+b-1;
201
 
}
202
 
 
203
 
 
204
 
uint32_t convert_month_to_period(uint32_t month)
205
 
{
206
 
  uint32_t year;
207
 
  if (month == 0L)
208
 
    return 0L;
209
 
  if ((year=month/12) < 100)
210
 
  {
211
 
    year+=(year < YY_PART_YEAR) ? 2000 : 1900;
212
 
  }
213
 
  return year*100+month%12+1;
214
 
}
215
 
 
216
 
 
217
188
/*
218
189
  Convert a timestamp string to a DRIZZLE_TIME value and produce a warning
219
190
  if string was truncated during conversion.