Beispiel #1
0
/* Non-thread safe versions of the above */
struct TM *localtime64(const Time64_T *time_) {
#ifdef _MSC_VER
    _tzset();
#else
    tzset();
#endif
    return localtime64_r(time_, &Static_Return_Date);
}
Beispiel #2
0
  // Returns the environment time zone.
  String* Time::env_zone(STATE) {
    struct tm64 tm;

    tzset();
    localtime64_r(&seconds_, &tm);

    if(tm.tm_zone) {
      return locale_string(state, tm.tm_zone);
    } else {
      return nil<String>();
    }
  }
Beispiel #3
0
  struct tm64 Time::get_tm() {
    time64_t seconds = seconds_;
    struct tm64 tm = {0};

    if(Fixnum* off = try_as<Fixnum>(offset_)) {
      seconds += off->to_long_long();
      gmtime64_r(&seconds, &tm);
    } else if(CBOOL(is_gmt_)) {
      gmtime64_r(&seconds, &tm);
    } else {
      tzset();
      localtime64_r(&seconds, &tm);
    }

    return tm;
  }
Beispiel #4
0
/* Non-thread safe versions of the above */
struct TM *localtime64(const Time64_T *time) {
    return localtime64_r(time, &Static_Return_Date);
}
Beispiel #5
0
char *ctime64_r( const Time64_T* time, char* result ) {
    struct TM date;

    localtime64_r( time, &date );
    return asctime64_r( &date, result );
}