-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POSIX::strftime bugfeature: incorrect mktime() call #838
Comments
From netch@lucky.netGMTime of unixtime 941284799 is 30th of October, 1999, 11:59:59. The following code: #!/usr/bin/perl prints 1999 10 30 12 59 59 (note environment information: timezone is Europe/Kiev) This effect (adding of 1 hour) appeared in perl 5.00503 and did not exist in Diff of ${perl}/ext/POSIX/POSIX.xs between 5.00502 and 5.00503 ==={ char * Well, test it and see that mktime() normalizes time according to ==={ void f( int x ) int main() { output is: ==={ This mktime() behavior possibly correct and in any case accords to its man page: ==={ But, the time in question was GMT time, not local time. Thus, perl MUST NOT call mktime() in strftime() because strftime MUST >Fix: (For FreeBSD only. This text originally was PR to FreeBSD.) (note: spaces/tabs are incorrect in this diff) Inline Patch--- src/contrib/perl5/ext/POSIX/POSIX.xs.orig Wed May 5 16:15:29 1999
+++ src/contrib/perl5/ext/POSIX/POSIX.xs Wed Nov 10 20:04:30 1999
@@ -3617,21 +3617,20 @@
CODE:
{
char tmpbuf[128];
struct tm mytm;
int len;
- init_tm(&mytm); /* XXX workaround - see init_tm() above */
+ bzero(&mytm, sizeof(mytm));
mytm.tm_sec = sec;
mytm.tm_min = min;
mytm.tm_hour = hour;
mytm.tm_mday = mday;
mytm.tm_mon = mon;
mytm.tm_year = year;
mytm.tm_wday = wday; mytm.tm_yday = yday; Perl Info
|
From [Unknown Contact. See original ticket]On Wed, 10 Nov 1999 at 21:51:22 +0200, Valentin Nechayev wrote:
This is fixed, it appears, in 5.00562 [*] [ 4223] By: gsar on 1999/09/24 05:05:06 One cannot do without this normalisation if the optionality of the three Ian [*] I really must get round to loading 5.00562... unfortunately, my |
Migrated from rt.perl.org#1766 (status was 'resolved')
Searchable as RT1766$
The text was updated successfully, but these errors were encountered: