Issue #7445 has been updated by felipec (Felipe Contreras).


tadf (tadayoshi funaba) wrote:
> DateTime also does.
> 
> $ ruby -r date -e 'dt=DateTime.now; ARGV.each{|f| p dt.strftime(f)}' '%s' '%s %z'
> "1369651261"
> "1369651261 +0900"
> 
> so what?

./test '0 +0100' '%s' '%s %z'
0
0 +0100

#define _XOPEN_SOURCE
#include <stdio.h>
#include <time.h>

int main(int argc, char *argv[]) {
	struct tm tm;
	char buf[0x100];
	for (int i = 2; i < argc; i++) {
		strptime(argv[1], argv[i], &tm);
		strftime(buf, sizeof(buf), argv[i], &tm);
		printf("%s\n", buf);
	}
	return 0;
}
----------------------------------------
Bug #7445: strptime('%s %z') doesn't work
https://bugs.ruby-lang.org/issues/7445#change-39781

Author: felipec (Felipe Contreras)
Status: Assigned
Priority: Low
Assignee: tadf (tadayoshi funaba)
Category: lib
Target version: Next Major
ruby -v: ruby 1.9.3p327
Backport: 


See:

    ruby -e "require 'date'; p DateTime.strptime('0 +0100', '%s %z').strftime('%s %z')"

The timezone is ignored.


-- 
http://bugs.ruby-lang.org/