这是一个创建于 3520 天前的主题,其中的信息可能已经有所发展或是发生改变。
我感觉比占位符的方式直观呀,接下来等诸位大神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 条回复 • 2014-11-04 16:40:58 +08:00
![leedstyh](https://cdn.v2ex.com/avatar/cd4e/651a/62563_normal.png?m=1401788885) |
|
1
leedstyh 2014-11-04 14:55:00 +08:00 via Android
这么直观的,你都能记错
|
![gihnius](https://cdn.v2ex.com/gravatar/a036a58102248e7ca5595d7fd2e014f0?s=48&d=retro) |
|
2
gihnius 2014-11-04 15:16:39 +08:00
是这个:一月二日下午三点四分五秒零六年西七区
|
![jason52](https://cdn.v2ex.com/avatar/9191/b0a3/32421_normal.png?m=1429009988) |
|
3
jason52 2014-11-04 16:40:58 +08:00
@ leedstyh 我没用过啊。。。。只是听了podcast随便写的。。。。o(╯□╰)o
|