* strftime.c (rb_strftime): calc timezone offset by myself if system
doesn't provide timezone info. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0f81455429
commit
d4c5212794
@ -1,3 +1,8 @@
|
|||||||
|
Mon Sep 1 02:55:15 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* strftime.c (rb_strftime): calc timezone offset by myself if system
|
||||||
|
doesn't provide timezone info.
|
||||||
|
|
||||||
Mon Sep 1 02:48:28 2008 Tanaka Akira <akr@fsij.org>
|
Mon Sep 1 02:48:28 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* tool/transcode-tblgen.rb: change "illegal" to "invalid".
|
* tool/transcode-tblgen.rb: change "illegal" to "invalid".
|
||||||
|
@ -477,6 +477,15 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
|
|||||||
#ifdef HAVE_GETTIMEOFDAY
|
#ifdef HAVE_GETTIMEOFDAY
|
||||||
gettimeofday(&tv, &zone);
|
gettimeofday(&tv, &zone);
|
||||||
off = -zone.tz_minuteswest;
|
off = -zone.tz_minuteswest;
|
||||||
|
#else
|
||||||
|
/* no timezone info, then calc by myself */
|
||||||
|
{
|
||||||
|
struct tm utc;
|
||||||
|
time_t now;
|
||||||
|
time(&now);
|
||||||
|
utc = *gmtime(&now);
|
||||||
|
off = (now - mktime(&utc)) / 60;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* !HAVE_TIMEZONE */
|
#endif /* !HAVE_TIMEZONE */
|
||||||
#endif /* !HAVE_TM_ZONE */
|
#endif /* !HAVE_TM_ZONE */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user