You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs for impl fmt::Display for tzrs::Time indicate that this impl can be used as the implementation of Ruby methods Time#to_s, Time#inspect, Time#asctime, and Time#ctime:
/*** Some systems only handle "%.2d"; others only handle "%02d";** "%02.2d" makes (most) everybody happy.** At least some versions of gcc warn about the %02.2d;** we conditionalize below to avoid the warning.*//*** All years associated with 32-bit time_t values are exactly four digits long;** some years associated with 64-bit time_t values are not.** Vintage programs are coded for years that are always four digits long** and may assume that the newline always lands in the same place.** For years that are less than four digits, we pad the output with** leading zeroes to get the newline in the traditional place.** The -4 ensures that we get four characters of output even if** we call a strftime variant that produces fewer characters for some years.** The ISO C and POSIX standards prohibit padding the year,** but many implementations pad anyway; most likely the standards are buggy.*/#ifdef__GNUC__#defineASCTIME_FMT "%s %s%3d %2.2d:%2.2d:%2.2d %-4s\n"
#else/* !defined __GNUC__ */#defineASCTIME_FMT "%s %s%3d %02.2d:%02.2d:%02.2d %-4s\n"
#endif/* !defined __GNUC__ *//*** For years that are more than four digits we put extra spaces before the year** so that code trying to overwrite the newline won't end up overwriting** a digit within a year and truncating the year (operating on the assumption** that no output is better than wrong output).*/#ifdef__GNUC__#defineASCTIME_FMT_B "%s %s%3d %2.2d:%2.2d:%2.2d %s\n"
#else/* !defined __GNUC__ */#defineASCTIME_FMT_B "%s %s%3d %02.2d:%02.2d:%02.2d %s\n"
#endif/* !defined __GNUC__ */#defineSTD_ASCTIME_BUF_SIZE 26
The docs for
impl fmt::Display for tzrs::Time
indicate that this impl can be used as the implementation of Ruby methodsTime#to_s
,Time#inspect
,Time#asctime
, andTime#ctime
:artichoke/spinoso-time/src/time/tzrs/convert.rs
Lines 6 to 41 in fccc282
In MRI,
ctime
is an alias forasctime
.asctime
,to_s
, andinspect
are all implemented differently.This ticket tracks the work to addd dedicated support for returning time in these formats (iterators? methods that return
String
?)Actual Behavior
MRI 3.1.2:
MRI Implementation
asctime
MRI
https://github.com/ruby/ruby/blob/v3_1_2/time.c#L3975-L3990
Time Zone Database
https://github.com/eggert/tz/blob/2022a/asctime.c
to_s
https://github.com/ruby/ruby/blob/v3_1_2/time.c#L3992-L4017
inspect
https://github.com/ruby/ruby/blob/v3_1_2/time.c#L4019-L4071
The text was updated successfully, but these errors were encountered: