这很棘手,因为这些库(例如timeago)也会将时间翻译为“不到一分钟前”(您无法将其翻译回准确的时间)
对于精确的表达(例如“3个月前”),您需要使用time.AddDate()(此处t.AddDate(0, -3, 0).Month())
Time.Format然后,您可以使用或将结果时间格式化为您想要的任何日期格式metakeule/fmtdate。
| 归档时间: |
|
| 查看次数: |
1645 次 |
| 最近记录: |