Files
mruby-mruby/mrbgems/mruby-time/include/mruby/time.h
T
dearblue fda5c0c073 Fix the lack of precision for Time; ref d74355061
- `Time.local` and `Time.utc` are able to use with `MRB_INT16 + MRB_WITHOUT_FLOAT`.

  - `time_t` is converted directly from the Ruby object.

  - `time + sec` and` time - sec` are not affected by the precision of `mrb_float`.

    Similarly, calculations are possible with `MRB_INT16 + MRB_WITHOUT_FLOAT`.
2019-07-27 21:25:18 +09:00

27 lines
466 B
C

/*
** mruby/time.h - Time class
**
** See Copyright Notice in mruby.h
*/
#ifndef MRUBY_TIME_H
#define MRUBY_TIME_H
#include "mruby/common.h"
#include <time.h>
MRB_BEGIN_DECL
typedef enum mrb_timezone {
MRB_TIMEZONE_NONE = 0,
MRB_TIMEZONE_UTC = 1,
MRB_TIMEZONE_LOCAL = 2,
MRB_TIMEZONE_LAST = 3
} mrb_timezone;
MRB_API mrb_value mrb_time_at(mrb_state *mrb, time_t sec, time_t usec, mrb_timezone timezone);
MRB_END_DECL
#endif /* MRUBY_TIME_H */