获取当前时间
1 | now = arrow.utcnow() |
时间增减
1 | >>> one_hour_ago = now.replace(hours = -1) |
时区修改
1 | now_local = now.to('Asia/Shanghai') |
字符串转时间
1 | arrow.get(' 2014-12-12T00:00:00.000+0800') |
时间戳
1 | now_local.timestamp |
格式化
1 | now_local.format("YYYYMMDD") |
本地化个性时间短语
1 | now_local.humanize() |