<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>boyishwei (JS)</title>
    <link>https://ruby-china.org/boyishwei</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>[Guangzhou] HSBC Recruiting Senior/Junior Developer and QA Tester</title>
      <description>&lt;h2 id="Who we are?"&gt;Who we are?&lt;/h2&gt;
&lt;p&gt;We are HSBC, which was founded in 1865 in Hongkong and Shanghai to finance trade between Asia and the West, today HSBC is one of the world’s largest banking and financial services organisations serving around 38 million customers worldwide, we offer local bank serving for internaltional needs. Our aim is to be acknowledged as the world’s leading and most respected international bank.&lt;/p&gt;
&lt;h2 id="What candidates we are looking for?"&gt;What candidates we are looking for?&lt;/h2&gt;
&lt;p&gt;We are looking for forward-thinking, driving, perceptive and innovative talents who are dependable and open to different cultures.
Currently, we are having many hire count opened, we are recruiting Senior/Junior Engineers, QA Testers, Business Analyser etc... &lt;/p&gt;

&lt;p&gt;For senior engineers our team are hiring, we want you master below skills:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Good English communicate skills is essential, including written and oral in English&lt;/li&gt;
&lt;li&gt;Java 8, J2EE, Spring Framework, XML, XSD, Unit test automation skills is essential. Spring-boot is advantageous&lt;/li&gt;
&lt;li&gt;Experience of SQL and relational databases is essential and experience of Oracle advantageous.&lt;/li&gt;
&lt;li&gt;Experience of working in unix environments is essential.&lt;/li&gt;
&lt;li&gt;Experience of REST services is advantageous.&lt;/li&gt;
&lt;li&gt;Good understanding of working in Agile and DevOps environment is essential&lt;/li&gt;
&lt;li&gt;Demonstrable experience of Continuous Delivery software development methods, including TDD and automated testing (including non-functional testing). Experience of working with Puppet/Ansible is advantageous&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is just one of our opening position. For more hire count, please contact us directly.&lt;/p&gt;
&lt;h2 id="What you’ll be responsible?"&gt;What you’ll be responsible?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Understand the business requirements and working closely with business users and IT teams to develop solutions/software to support the businesses.&lt;/li&gt;
&lt;li&gt;Build, deliver and test applications using Agile methodologies and perform regression testing on all devices.&lt;/li&gt;
&lt;li&gt;Mandatory to understand the security protocols as well as compliance and regulations.&lt;/li&gt;
&lt;li&gt;Understand the deployment procedure.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="Where we work?"&gt;Where we work?&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://ditu.amap.com/place/B00141JO30" rel="nofollow" target="_blank" title=""&gt;Guangzhou, Tianhe, Taikoohui&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://i2.bvimg.com/594445/2403d7b02995c891.jpg" title="" alt="Markdown"&gt;&lt;/p&gt;
&lt;h2 id="What we offer?"&gt;What we offer?&lt;/h2&gt;
&lt;p&gt;HSBC is one of the world’s leading banks, with a network covering 67 countries and territories. Our size and global reach mean we offer many ways for you to develop your career.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We offer an inclusive, values-led culture, tailored learning and development programmes and competitive benefits.&lt;/li&gt;
&lt;li&gt;Work with people globally, basically every team in HSBC is global team, you need to work with people in different region and different timezone.&lt;/li&gt;
&lt;li&gt;Training, we have well structured trainings, which could cover security, technical, comminucation, project management etc...&lt;/li&gt;
&lt;li&gt;Flexible work time&lt;/li&gt;
&lt;li&gt;Home office in HSBC&lt;/li&gt;
&lt;li&gt;Anuual Leave, take GCB 5 Level for example, you can have 20 days annual leave, if you take all the leaves together, and count in the weekends, you can take almost one month leave. &lt;/li&gt;
&lt;li&gt;We offer over average marketing level package for you.&lt;/li&gt;
&lt;li&gt;Canteen, variety of food for you, not free, but it's very cheap.&lt;/li&gt;
&lt;li&gt;About OT, normally, we never OT, except support team, and you can get paid once you have.&lt;/li&gt;
&lt;li&gt;Clubs, we have so many clubs  in HSBC, tennis/badminton/basketball/football/dancing/singing/gym and so on, you can join any of them, as long as you get enough time. &lt;/li&gt;
&lt;li&gt;Activities, we have so many activities among clubs or when any festivals, below are some videos of our Annual Party 2017, hope it could give you a partial view of who we are:

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://v.youku.com/v_show/id_XMzU1NzU1NjgzNg==.html?spm=a2h3j.8428770.3416059.1" rel="nofollow" target="_blank" title=""&gt;10 sec of HSDC Annual Party 2017&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://v.youku.com/v_show/id_XMzQ5MTEwODU5Mg==.html?spm=a2h0k.8191407.0.0&amp;amp;from=s1.8-1-1.2" rel="nofollow" target="_blank" title=""&gt;Annual Party MV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://v.youku.com/v_show/id_XMzQ5MDQ3MDM4OA==.html?spm=a2h0k.8191407.0.0&amp;amp;from=s1.8-1-1.2" rel="nofollow" target="_blank" title=""&gt;Lucky draw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="How to contact?"&gt;How to contact?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Mail to: ryan.w.jiang@hsbc.com.cn&lt;/li&gt;
&lt;li&gt;Wechat: boyishwei&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't Hesitate to send us mails or drop us a message. If you don't try, you never know how good you are and could be...&lt;/p&gt;</description>
      <author>boyishwei</author>
      <pubDate>Mon, 23 Apr 2018 00:20:01 +0800</pubDate>
      <link>https://ruby-china.org/topics/35509</link>
      <guid>https://ruby-china.org/topics/35509</guid>
    </item>
    <item>
      <title>看过 yinwang 写的这篇文章， 很想了解大家怎么看的</title>
      <description>&lt;p&gt;看过 Linux 中国微信公众号转发的 wangyin 的文章，&lt;a href="http://www.yinwang.org/blog-cn/2016/01/18/java/" rel="nofollow" target="_blank" title=""&gt;给 Java 说句公道话&lt;/a&gt;
本来写了很多我自己的评论，然后都删了。归结为一句最能表达我的看法：
wangyin 也不过是一个从国内移居到国外的喷子！&lt;/p&gt;</description>
      <author>boyishwei</author>
      <pubDate>Fri, 29 Jan 2016 17:43:12 +0800</pubDate>
      <link>https://ruby-china.org/topics/28909</link>
      <guid>https://ruby-china.org/topics/28909</guid>
    </item>
    <item>
      <title>Hello EMC</title>
      <description>&lt;p&gt;We are family now!&lt;/p&gt;</description>
      <author>boyishwei</author>
      <pubDate>Tue, 13 Oct 2015 00:44:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/27646</link>
      <guid>https://ruby-china.org/topics/27646</guid>
    </item>
    <item>
      <title>What Ruby could do? </title>
      <description>&lt;p&gt;Front End? Back End? Mobile like Android or IOS? Embedded device? Broswer?............Yes, all of them, that means a lot, that means everything...........&lt;/p&gt;

&lt;p&gt;&lt;a href="http://astonj.com/tech/ruby-is-about-to-get-red-hot-again" rel="nofollow" target="_blank"&gt;http://astonj.com/tech/ruby-is-about-to-get-red-hot-again&lt;/a&gt;&lt;/p&gt;</description>
      <author>boyishwei</author>
      <pubDate>Thu, 13 Nov 2014 11:46:59 +0800</pubDate>
      <link>https://ruby-china.org/topics/22644</link>
      <guid>https://ruby-china.org/topics/22644</guid>
    </item>
    <item>
      <title>论坛在做升级么，貌似有些贴子看不到，时间显示也不对</title>
      <description>&lt;p&gt;RT....&lt;/p&gt;</description>
      <author>boyishwei</author>
      <pubDate>Tue, 21 Jan 2014 23:26:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/16916</link>
      <guid>https://ruby-china.org/topics/16916</guid>
    </item>
    <item>
      <title>请教一个 ruby-china 论坛代码问题</title>
      <description>&lt;p&gt;一边学，一边在做项目，前段时间把 ruby-china 的源码 clone 了一份到本地，用心的在研究，先谢谢论坛的大神哈，受益良多，谢过谢过 :)&lt;/p&gt;

&lt;p&gt;今天看到一个小细节，没看懂，向大家请教一下:
论坛功能中，在每次回复后，都要去更新帖子的最后回复人以及最后回复时间:
在代码&lt;code&gt;reply.rb&lt;/code&gt;及&lt;code&gt;topic.rb&lt;/code&gt; 中&lt;/p&gt;

&lt;p&gt;&lt;code&gt;reply.rb&lt;/code&gt;中的代码段：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;after_create&lt;/span&gt; &lt;span class="ss"&gt;:update_parent_topic&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_parent_topic&lt;/span&gt;
    &lt;span class="n"&gt;topic&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update_last_reply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;topic.rb&lt;/code&gt;中的代码段：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_last_reply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# replied_at 用于最新回复的排序，如果贴着创建时间在一个月以前，就不再往前面顶了&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;last_active_mark&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_i&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;created_at&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;month&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ago&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replied_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;last_reply_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;last_reply_user_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;user_id&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;last_reply_user_login&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;try&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:login&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没想明白的问题就是：在 topic.rb 的 update_last_reply 中，self 是如何对应上 reply 的 topic 的，没有看到那里有对 self 有显示的指定啊，比如 self=reply.topic，难道这里也是一个 convention over configuration 的案例吗。&lt;/p&gt;

&lt;p&gt;感觉好像是我学的时候漏了什么点没学到，问题可能很白痴，但就是没想明白，别见笑哈... :)&lt;/p&gt;

&lt;p&gt;另外补充一个问题：
还有那些其他比较优秀的开源项目可以 clone 下来学习，参考一下的。经过一段时间学习跟实际开发之后，再观摩其他大神的 code 方式，应该是，至少我觉得，这个阶段帮助我提升最快的一种方式。从规划，代码风格，以及一些细节实现方式上，都有让人眼前一亮的感觉，比如看 ruby-china 的源码，就让我一路亮着。希望能观摩更多其它大神的佳作，如饥似渴啊...哈哈，论坛 wiki 里也有非常多的好东西哈，谢谢整理 wiki 的大神，,,:)&lt;/p&gt;</description>
      <author>boyishwei</author>
      <pubDate>Wed, 18 Dec 2013 01:11:40 +0800</pubDate>
      <link>https://ruby-china.org/topics/16263</link>
      <guid>https://ruby-china.org/topics/16263</guid>
    </item>
    <item>
      <title>Rails 中的时区及时间问题</title>
      <description>&lt;p&gt;Rails 中的时区及时间问题，做项目的过程中发现页面中显示时间不大对，然后折腾了半天把这个算是弄清楚了，记录下来，以免其他人也掉进这个坑。&lt;/p&gt;

&lt;p&gt;论坛里之前有过相关的讨论贴，但我觉得没说彻底:
&lt;a href="http://ruby-china.org/topics/5940" rel="nofollow" target="_blank"&gt;http://ruby-china.org/topics/5940&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;首先：时区时间换算关系&lt;/strong&gt;
UTC 时间 + 时差 = 当地时间&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;其次：确认服务器时间正确&lt;/strong&gt;
保证你服务上时间及时区正确无误，特别是时区。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;最后了解 Rails 中的时间设定机制&lt;/strong&gt;
Rails3、4 中，默认采用 UTC 时间进行存储，不管你服务器上设定的是那个时区，当前什么时间，默认情况下，Rails 都会将其转换为 UTC 时间，然后再存在数据库中，在页面中显示也是如此。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;比如&lt;/strong&gt;
&lt;code&gt;Local Time: 2013-12-13 18:00&lt;/code&gt;  (北京时间 +800 )
&lt;strong&gt;那么&lt;/strong&gt;
&lt;code&gt;UTC Time：2013-12-13 10:00&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;如果在这个时间点，往 DB 中存了一条数据，Rails 默认情况下，存在 DB 中的时间是
2013-12-13 10:00，UTC 时间&lt;/p&gt;

&lt;p&gt;通过 created_at 获得的时间并且在页面显示，也将是 &lt;code&gt;2013-12-13 10:00&lt;/code&gt;  UTC 时间。&lt;/p&gt;

&lt;p&gt;以上是 Rails 默认对时间的处理方式，也是鼓励这么做。&lt;/p&gt;

&lt;p&gt;这对我们开发者或者是很清楚时区换算关系的人来说，不是什么大问题，但对一般用户来说，这绝对不能接受。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;解决方式：&lt;/strong&gt;
在 application.rb 中添加以下两条配置，(以北京时间为例)&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time_zone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Beijing'&lt;/span&gt;
&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;active_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;default_timezone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;:local&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;通过添加这两条配置之后，你 DB 中的时间将以本地时间方式存储，在页面中显示的也将是本地时间。问题解决。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;延伸&lt;/strong&gt;
config.time_zone = 'Beijing'
config.active_record.default_timezone = :local
这两条配置到底分别起到什么作用，我上周做过一组测试：&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test One:&lt;/strong&gt;
默认配置，即：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time_zone&lt;/span&gt;
&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;active_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;default_timezone&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;均不做配置&lt;/p&gt;

&lt;p&gt;存储数据到 DB 时间：2013-12-07 10:54:57 (北京时间)&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB时间                        2013-12-07 02:54:57
created_at                    2013-12-07 02:54:57 UTC
created_at.localtime          2013-12-07 10:54:57 CST
created_at.utc                2013-12-07 02:54:57 UTC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看出数据库时间是 UTC 时间，created_at 也是 UTC 时间，created_at.localtime 是北京时间&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test Two:&lt;/strong&gt;
配置：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time_zone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Beijing'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;config.active_record.default_timezone&lt;/code&gt;不做配置&lt;/p&gt;

&lt;p&gt;存储数据到 DB 时间：2013-12-07 10:57:55 (北京时间)&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB时间                        2013-12-07 02:57:55
created_at                    2013-12-07 10:57:55 +0800 CST
created_at.localtime          2013-12-07 10:57:55 CST
created_at.utc                2013-12-07 02:57:55 UTC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可见 config.time_zone = 'Beijing'配置的作用，是在 ActiveRecord 中取时间的时候，将 UTC 时间转换成 Local 时间，也就是通过 created_at 等方法获取到的将直接是 Local 时间。而存储在 DB 中的时间仍然是 UTC 时间。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test Three:&lt;/strong&gt;
配置：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time_zone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Beijing'&lt;/span&gt;
&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;active_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;default_timezone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;:local&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;存储数据到 DB 时间：2013-12-07 11:02:56 (北京时间)&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB时间                        2013-12-07 11:02:56
created_at                    2013-12-07 11:02:56 +0800
created_at.localtime          2013-12-07 11:02:56 CST
created_at.utc                2013-12-07 03:02:56 UTC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可见 config.active_record.default_timezone = :local 配置的作用，是在 ActiveRecord 中往数据库存放数据时，将按 Local 时间进行存储，通过添加这两项配置，就可以实现数据库存放时间以及通过 created_at 等方法取到的时间均为 Local 时间。&lt;/p&gt;

&lt;p&gt;另外可以看出，只要你的服务器时区及时间设置正确，任何配置情况下，created_at.localtime 输出的时间均是正确的 Local 时间。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;created_at.localtime(:db).to_s&lt;/strong&gt;
如果不想在页面中显示本地时区及时差的话，可以通过 created_at.localtime(:db).to_s 去掉，
如
&lt;code&gt;2013-12-07 11:02:56 CST&lt;/code&gt;
通过调用 created_at.localtime(:db).to_s 得到的将是:
&lt;code&gt;2013-12-07 11:02:56&lt;/code&gt;&lt;/p&gt;</description>
      <author>boyishwei</author>
      <pubDate>Fri, 13 Dec 2013 17:55:00 +0800</pubDate>
      <link>https://ruby-china.org/topics/16187</link>
      <guid>https://ruby-china.org/topics/16187</guid>
    </item>
    <item>
      <title>能有人讲解下 response_to |format| 这块吗，一直没弄明白</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;respond_to&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;html&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;redirect_to&lt;/span&gt; &lt;span class="vi"&gt;@image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;notice: &lt;/span&gt;&lt;span class="s1"&gt;'Image was successfully created.'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;json: &lt;/span&gt;&lt;span class="vi"&gt;@image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;status: :created&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;location: &lt;/span&gt;&lt;span class="vi"&gt;@image&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;js&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;response 如何知道应该按什么 type 来 process？as JS，as HTML？
format 是怎么来的，什么将决定 format 的类型？&lt;/p&gt;

&lt;p&gt;有点困惑，别见笑。求高手帮我理下....&lt;/p&gt;</description>
      <author>boyishwei</author>
      <pubDate>Fri, 29 Nov 2013 10:55:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/15879</link>
      <guid>https://ruby-china.org/topics/15879</guid>
    </item>
  </channel>
</rss>
