Use own implementation to calculate UTC offset on Visual Studio 2015 or
earlier or MinGW because `strftime("%z")` on these environments does not
conform C99.
For the following reasons:
- Ruby compatibility.
- Add UTC offset (time zone informations was not included by #4433).
- More readable.
Example:
Before this patch:
p Time.gm(2003,4,5,6,7,8,9) #=> Sat Apr 5 06:07:08 2003
p Time.local(2013,10,28,16,27,48) #=> Mon Oct 28 16:27:48 2013
After this patch:
p Time.gm(2003,4,5,6,7,8,9) #=> 2003-04-05 06:07:08 UTC
p Time.local(2013,10,28,16,27,48) #=> 2013-10-28 16:27:48 +0900
Implementation:
I use `strftime(3)` because UTC offset can be added and program size become
smaller than the other implementations (using `sprintf(3)`, self conversion
etc) in my environment.
- A leading charactor for day is space.
- Time zone does not included.
Before this patch:
Time.gm(1982,3,4,5,6,7).asctime #=> "Thu Mar 04 05:06:07 UTC 1982"
After this patch:
Time.gm(1982,3,4,5,6,7).asctime #=> "Thu Mar 4 05:06:07 1982"