6 struct vtm
{/* dummy for TAGS */};
8 PACKED_STRUCT_UNALIGNED(struct vtm
{
9 VALUE year
; /* 2000 for example. Integer. */
10 VALUE subsecx
; /* 0 <= subsecx < TIME_SCALE. possibly Rational. */
11 VALUE utc_offset
; /* -3600 as -01:00 for example. possibly Rational. */
12 VALUE zone
; /* "JST", "EST", "EDT", etc. as String */
13 unsigned int yday
:9; /* 1..366 */
14 unsigned int mon
:4; /* 1..12 */
15 unsigned int mday
:5; /* 1..31 */
16 unsigned int hour
:5; /* 0..23 */
17 unsigned int min
:6; /* 0..59 */
18 unsigned int sec
:6; /* 0..60 */
19 unsigned int wday
:3; /* 0:Sunday, 1:Monday, ..., 6:Saturday 7:init */
20 unsigned int isdst
:2; /* 0:StandardTime 1:DayLightSavingTime 3:init */
23 #define TIME_SCALE 1000000000
25 #ifndef TYPEOF_TIMEVAL_TV_SEC
26 # define TYPEOF_TIMEVAL_TV_SEC time_t
28 #ifndef TYPEOF_TIMEVAL_TV_USEC
29 # if INT_MAX >= 1000000
30 # define TYPEOF_TIMEVAL_TV_USEC int
32 # define TYPEOF_TIMEVAL_TV_USEC long
36 #if SIZEOF_TIME_T == SIZEOF_LONG
37 typedef unsigned long unsigned_time_t
;
38 #elif SIZEOF_TIME_T == SIZEOF_INT
39 typedef unsigned int unsigned_time_t
;
40 #elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
41 typedef unsigned LONG_LONG unsigned_time_t
;
43 # error cannot find integer type which size is same as time_t.
47 #ifdef RUBY_ENCODING_H
48 VALUE
rb_strftime_timespec(const char *format
, size_t format_len
, rb_encoding
*enc
,
49 VALUE time
, const struct vtm
*vtm
, struct timespec
*ts
, int gmt
);
50 VALUE
rb_strftime(const char *format
, size_t format_len
, rb_encoding
*enc
,
51 VALUE time
, const struct vtm
*vtm
, VALUE timev
, int gmt
);
55 VALUE
rb_time_zone_abbreviation(VALUE zone
, VALUE time
);