duanbi7204
2019-05-08 05:14
浏览 828
已采纳

从时间字符串获取小时和分钟

I have response from an API like below

2019-05-08T10:36:00+0530

I want to take 10:36 from it, right now I do something with regex like

preg_match('/T(.*?)\:00/');

It works, but is there any other actual way to do it more efficiently? That works on any time string in this format?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题