用C解析日期Http Header的简单方法是什么? [英] What is an easy way to parse a date Http Header in C?

查看:131
本文介绍了用C解析日期Http Header的简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想解析电子邮件http日期标头,是否有一种简单的方法而无需编写自己的字符串解析函数呢?

I want to parse an email http date header, is there an easy way to do it without writing my own string parsing functions?

示例:

Date: Fri, 19 Mar 2010 11:44:02 -0700

为澄清起见,解析Date:部分很简单,我在谈论实际的日期字符串.理想情况下,id喜欢获取纪元时间.

To clarify, parsing out the Date: part is easy, im talking about the actual date string. Ideally, id like to get the epoch time.

推荐答案

如果在目标系统(例如Linux)中可用,则可以使用

If it's available in your target system (eg Linux) you can use strptime.

这篇关于用C解析日期Http Header的简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆