jason52

听了最近一期内核恐慌,rio 说的 golang 格式化时间的思路的确挺好的啊

  •  
  •   jason52 · Nov 4, 2014 · 2922 views
    This topic created in 4297 days ago, the information mentioned may be changed or developed.
    我感觉比占位符的方式直观呀,接下来等诸位大神port到其他语言。

    相当于将一个固定的字符串作为一个标杆,他又精心设计了这个,字符串,年月日,分钟小时都不会重复。

    差不多是这样:

    time_str1 = time_to_str(true_time,"2006-05-04 03:02:01")
    time_str2 = time_to_str(true_time,"2006/05/04 03:02:01")
    time_str3 = time_to_str(true_time,"2006 05 04 03:02:01")
    time_str4 = time_to_str(true_time,"2006:05:04 03:02:01")
    3 replies    2014-11-04 16:40:58 +08:00
    leedstyh
        1
    leedstyh  
       Nov 4, 2014 via Android
    这么直观的,你都能记错
    gihnius
        2
    gihnius  
       Nov 4, 2014
    是这个:一月二日下午三点四分五秒零六年西七区
    jason52
        3
    jason52  
    OP
       Nov 4, 2014
    @leedstyh 我没用过啊。。。。只是听了podcast随便写的。。。。o(╯□╰)o
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5246 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 05:59 · PVG 13:59 · LAX 22:59 · JFK 01:59
    ♥ Do have faith in what you're doing.