java设计当前的时间表_时间和日历类的设计(Java的Date和Calendar的C++实现)

时间和日历类的设计

C++通用框架的设计作者:naven

1介绍

时间和日历以及时间的格式化处理在软件的设计中起着非常重要的作用,但是目前C++的库却未有一个简单易用的时间类,大部分都需要开发者直接调用操作系统的API来完成,而且很多API都不是线程安全的。某些大型的C++框架虽然提供一些时间类,但是却不通用,也很难直接拿出来使用。下面介绍一下参考Java Framework中的时间相关的类来设计并实现C++版本的时间和日历类。

主要有如下一些类

Time类,对应于Java的java.util.Date类,表示特定的瞬间,精确到毫秒(Linux可精确到微秒,Solaris可精确到十亿分之一秒)。Time只表示某时某地的瞬间,从1970年1月1日00:00:00 GMT以来的微秒数,无时区。

Calendar类,对应于Java的java.util.Calendar类,它既表示了Time的精确瞬间,还代表了此时的年、月、日、时区等。它为特定瞬间与一组诸如YEAR、MONTH、DAY_OF_MONTH、HOUR等日历字段之间的转换提供了一些方法,并为操作日历字段(例如获得下星期的日期)提供了一些方法。瞬间可用微秒值来表示,它是距历元(即格林威治标准时间1970 年 1月1日的00:00:00.000,GMT)的偏移量。

TimeFormat类,类似Java的java.text.SimpleDateFormat类,它用来将时间和日历格式化成一个本地时间格式的文本形式,或者指定格式的文本形式。如果格式化时间,将缺省使用操作系统设定的本地(locale)时间格式处理。

TimeParser类,类似Java的java.text.SimpleDateFormat类,与TimeFormat相反,它用来将一个时间的文本转化成一个本地时间Time,缺省使用操作系统设定的本地时间格式处理。

2Hello World!

下面介绍一下它们的使用

cbef093dcc044b2793832001e2365e43.pngvoidmain() 

2f88ce130b654eb5dc6788e02dbcfc90.png

dbf989d57862681739b642d8621fe1f0.png918e8df969f9f8c8d002f25cda86cade.png{

df37983f39daa189b8c814e01a6a9011.png//获取当前时间,精确到微秒df37983f39daa189b8c814e01a6a9011.pngTime t=Time::getCurrentTime(); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png//使用CRT的API格式化时间,只能精确到秒df37983f39daa189b8c814e01a6a9011.pngtime_t tt=t.sec(); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", ctime(&tt)); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png//使用系统缺省的locale输出格式化时间文本df37983f39daa189b8c814e01a6a9011.pngTimeFormat tf("%c"); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tf.format(t).c_str()); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png//使用系统缺省的locale输出格式化时间文本df37983f39daa189b8c814e01a6a9011.pngTimeFormat tf2("%#c"); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tf2.format(t).c_str()); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png//自定义输出格式化时间文本,精确到豪秒df37983f39daa189b8c814e01a6a9011.pngTimeFormat tff("%Y-%m-%d %H:%M:%S.%q"); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tf2.format(t).c_str()); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png//自定义输出格式化时间文本,精确到豪秒,输出所有时间信息,包括时区和年代等df37983f39daa189b8c814e01a6a9011.pngTimeFormat tfCN("%G %Y年%B%d日 %A %H时%M分%S秒%q豪秒 时区%z","zh_CN.gb2312"); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tfCN.format(t).c_str()); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png//使用自定义 zh_CN.gb2312 的locale和字符集输出格式化时间文本,不受系统locale影响df37983f39daa189b8c814e01a6a9011.pngTimeFormat tfCN2("%G %Y %b %d %a %H:%M:%S.%q %z","zh_CN.gb2312"); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tfCN2.format(t).c_str()); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png//使用自定义 en_US.iso8859-1 的locale和字符集输出格式化时间文本,不受系统locale影响df37983f39daa189b8c814e01a6a9011.pngTimeFormat tfUS("%G %d %B %Y %A %H:%M:%S.%q TZ:%z","en_US.iso8859-1"); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tfUS.format(t).c_str()); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png    TimeFormat tfUS2("%G %Y %b %d %a %H:%M:%S.%q %z","en_US.iso8859-1"); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tfUS2.format(t).c_str()); 

df37983f39daa189b8c814e01a6a9011.png    

df37983f39daa189b8c814e01a6a9011.png//使用 MIME 标准格式输出格式化时间文本df37983f39daa189b8c814e01a6a9011.pngTimeFormat tfMIME("%a, %d %b %Y %H:%M:%S %z"); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tfMIME.format(t).c_str()); 

df37983f39daa189b8c814e01a6a9011.png

df37983f39daa189b8c814e01a6a9011.png//使用 MimeParse 方法转换时间df37983f39daa189b8c814e01a6a9011.pngTime t2=tf.mimeParse(tf.mimeFormat(t)); 

df37983f39daa189b8c814e01a6a9011.png    printf("\n%s\n", tfCN.format(t2).c_str()); 

df37983f39daa189b8c814e01a6a9011.png    

0ac3a2d53663ec01c7f7225264eeefae.png}cbef093dcc044b2793832001e2365e43.png

编译程序将输入如下结果

cbef093dcc044b2793832001e2365e43.pngWed Nov916:09:402005cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.png11/09/0516:09:40cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.pngWednesday, November09,200516:09:40cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.pngWednesday, November09,200516:09:40cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.png公元 2005年十一月09日 星期三 16时09分40秒078豪秒 时区+0800cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.png公元200511月09周三16:09:40.078+0800cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.pngAD09November2005Wednesday16:09:40.078TZ:+0800cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.pngAD2005Nov09Wed16:09:40.078+0800cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.pngWed,09Nov200516:09:40+0800cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.png公元 2005年十一月09日 星期三 16时09分40秒000豪秒 时区+0800cbef093dcc044b2793832001e2365e43.png

3Time类

由于Time要精确到微秒,所以Time类使用timeval结构存储时间,该结构包含两个long整形,一个表示秒数(从1970年1月1日00:00:00 GMT以来的偏移量),一个表示微秒数。

Time类的定义如下

cbef093dcc044b2793832001e2365e43.pngclassTime 

2f88ce130b654eb5dc6788e02dbcfc90.png

dbf989d57862681739b642d8621fe1f0.png918e8df969f9f8c8d002f25cda86cade.png

df37983f39daa189b8c814e01a6a9011.pngprivate:

f70a0fde2b51b7dd92a70e712e540cf6.png

edb48e6f68462ea23d9a824f01de40c5.png/**//**

df37983f39daa189b8c814e01a6a9011.png     * Store the values as a timeval which fields as.

df37983f39daa189b8c814e01a6a9011.png     * struct timeval {

df37983f39daa189b8c814e01a6a9011.png     *      long tv_sec;   // seconds

df37983f39daa189b8c814e01a6a9011.png     *      long tv_usec;  // microseconds 

4a5daaec04350a363f186a4d2c5ed6ce.png*/df37983f39daa189b8c814e01a6a9011.pngstructtimeval _tv;

0ac3a2d53663ec01c7f7225264eeefae.png}cbef093dcc044b2793832001e2365e43.png

Time类获取当前精确到微秒的实现如下(Win32提供的API只能精确到豪秒)

cbef093dcc044b2793832001e2365e43.pngTime

cbef093dcc044b2793832001e2365e43.pngTime::gettimeofday()

2f88ce130b654eb5dc6788e02dbcfc90.png

dbf989d57862681739b642d8621fe1f0.png918e8df969f9f8c8d002f25cda86cade.png{

df37983f39daa189b8c814e01a6a9011.png#ifdefined(HAVE_GETTIMEOFDAY)df37983f39daa189b8c814e01a6a9011.pngstructtimeval tp;

df37983f39daa189b8c814e01a6a9011.png    tp.tv_sec=0; 

df37983f39daa189b8c814e01a6a9011.png    tp.tv_usec=0; 

df37983f39daa189b8c814e01a6a9011.png#ifdef IS_SOLARIS_OS

df37983f39daa189b8c814e01a6a9011.png    ::gettimeofday(&tp,0);//microseconds = 1/1,000,000 secdf37983f39daa189b8c814e01a6a9011.pngTime nowtime(tp); 

df37983f39daa189b8c814e01a6a9011.png#elsedf37983f39daa189b8c814e01a6a9011.pngstructtimezone tz; 

df37983f39daa189b8c814e01a6a9011.png    tz.tz_dsttime=0; 

df37983f39daa189b8c814e01a6a9011.png    tz.tz_minuteswest=0; 

df37983f39daa189b8c814e01a6a9011.png    ::gettimeofday(&tp,&tz);//microseconds = 1/1,000,000 secdf37983f39daa189b8c814e01a6a9011.pngTime nowtime(tp); 

df37983f39daa189b8c814e01a6a9011.png#endifdf37983f39daa189b8c814e01a6a9011.pngreturnnowtime; 

df37983f39daa189b8c814e01a6a9011.png

df37983f39daa189b8c814e01a6a9011.png#elifdefined(HAVE_FTIME)df37983f39daa189b8c814e01a6a9011.pngstructtimeb tb;

df37983f39daa189b8c814e01a6a9011.png    tb.dstflag=0; 

df37983f39daa189b8c814e01a6a9011.png    tb.millitm=0; 

df37983f39daa189b8c814e01a6a9011.png    tb.time=0; 

df37983f39daa189b8c814e01a6a9011.png    tb.timezone=0; 

df37983f39daa189b8c814e01a6a9011.png    ftime(&tb);//milliseconds = 1/1,000 secdf37983f39daa189b8c814e01a6a9011.pngTime nowtime(tb); 

df37983f39daa189b8c814e01a6a9011.pngreturnnowtime; 

df37983f39daa189b8c814e01a6a9011.png

df37983f39daa189b8c814e01a6a9011.png#elifdefined(HAVE_CLOCK_GETTIME)df37983f39daa189b8c814e01a6a9011.pngstructtimespec ts; 

df37983f39daa189b8c814e01a6a9011.png    ts.tv_sec=0; 

df37983f39daa189b8c814e01a6a9011.png    ts.tv_nsec=0; 

df37983f39daa189b8c814e01a6a9011.png    ::clock_gettime(CLOCK_REALTIME,&ts);//nanoseconds = 1/1,000,000,000 secdf37983f39daa189b8c814e01a6a9011.pngTime nowtime(ts); 

df37983f39daa189b8c814e01a6a9011.pngreturnnowtime; 

df37983f39daa189b8c814e01a6a9011.png

df37983f39daa189b8c814e01a6a9011.png#elsedf37983f39daa189b8c814e01a6a9011.png//#warning "Time::gettimeofday()- low resolution timer: gettimeofday and ftime unavailable"df37983f39daa189b8c814e01a6a9011.pngTime nowtime(::time(0),0);//secondsdf37983f39daa189b8c814e01a6a9011.pngreturnnowtime; 

df37983f39daa189b8c814e01a6a9011.png

df37983f39daa189b8c814e01a6a9011.png#endif0ac3a2d53663ec01c7f7225264eeefae.png}cbef093dcc044b2793832001e2365e43.png

Time类提供很多方法如果构造方法和操作符等,可以在time_t和其他时间类型之间转换,也可以单独获取和设置时间的秒和微秒。

4Calendar类

Calendar类是一个表示日历的类,它可以实现日历的向前向后前进等所有功能。例如你可以设置,获取,和操纵一个日期对象的各个部分,比方一个月的一天或者是一个星期的一天。举例如下:

cbef093dcc044b2793832001e2365e43.png//定义日历对象并设置为当前时间cbef093dcc044b2793832001e2365e43.pngTime nowtm=Time::getCurrentTime(); 

cbef093dcc044b2793832001e2365e43.png    TimeFormat ntf("%Y-%m-%d %H:%M:%S.%q"); 

cbef093dcc044b2793832001e2365e43.png    printf("\n%s\n", ntf.format(nowtm).c_str()); 

cbef093dcc044b2793832001e2365e43.png    

cbef093dcc044b2793832001e2365e43.png    Calendar cal; 

cbef093dcc044b2793832001e2365e43.png    cal.setTime(nowtm); 

cbef093dcc044b2793832001e2365e43.png    

cbef093dcc044b2793832001e2365e43.png//年月日都向前移动一单位cbef093dcc044b2793832001e2365e43.pngcal.rollUpYear(); 

cbef093dcc044b2793832001e2365e43.png    cal.rollUpMonth(); 

cbef093dcc044b2793832001e2365e43.png    cal.rollUpDayOfMonth(); 

cbef093dcc044b2793832001e2365e43.png    

cbef093dcc044b2793832001e2365e43.png    String scal; 

cbef093dcc044b2793832001e2365e43.png    ntf.format(cal, scal); 

cbef093dcc044b2793832001e2365e43.png    printf("\n%s\n", scal.c_str());

cbef093dcc044b2793832001e2365e43.png

程序输出结果

cbef093dcc044b2793832001e2365e43.png2005-11-0916:45:54.589cbef093dcc044b2793832001e2365e43.png

cbef093dcc044b2793832001e2365e43.png2006-12-1016:45:54.589cbef093dcc044b2793832001e2365e43.png

Calendar类是建立在Time类的基础上的,并加入了时区等信息,它的定义看起来如下所示:

cbef093dcc044b2793832001e2365e43.pngclassCalendar

2f88ce130b654eb5dc6788e02dbcfc90.png

dbf989d57862681739b642d8621fe1f0.png918e8df969f9f8c8d002f25cda86cade.png{

df37983f39daa189b8c814e01a6a9011.pngprotected: 

f70a0fde2b51b7dd92a70e712e540cf6.png

edb48e6f68462ea23d9a824f01de40c5.png/**//**

df37983f39daa189b8c814e01a6a9011.png     * Value of the ERA field indicating

df37983f39daa189b8c814e01a6a9011.png     * the period before the common era (before Christ), also known as BCE.

df37983f39daa189b8c814e01a6a9011.png     * The sequence of years at the transition from BC to AD is

df37983f39daa189b8c814e01a6a9011.png     * 

918e8df969f9f8c8d002f25cda86cade.png, 2 BC, 1 BC, 1 AD, 2 AD,

918e8df969f9f8c8d002f25cda86cade.png

df37983f39daa189b8c814e01a6a9011.png     * @see Calendar#ERA

4a5daaec04350a363f186a4d2c5ed6ce.png*/df37983f39daa189b8c814e01a6a9011.pngint_era; 

df37983f39daa189b8c814e01a6a9011.png

f70a0fde2b51b7dd92a70e712e540cf6.png

edb48e6f68462ea23d9a824f01de40c5.png/**//**

df37983f39daa189b8c814e01a6a9011.png     * The currently set time for this calendar, expressed in milliseconds after

df37983f39daa189b8c814e01a6a9011.png     * January 1, 1970, 0:00:00 GMT.

df37983f39daa189b8c814e01a6a9011.png     * @see #isTimeSet

df37983f39daa189b8c814e01a6a9011.png     * @serial

4a5daaec04350a363f186a4d2c5ed6ce.png*/df37983f39daa189b8c814e01a6a9011.png    Time _time;

df37983f39daa189b8c814e01a6a9011.png

f70a0fde2b51b7dd92a70e712e540cf6.png

edb48e6f68462ea23d9a824f01de40c5.png/**//**

df37983f39daa189b8c814e01a6a9011.png     * The TimeZone used by this calendar. Calendar

df37983f39daa189b8c814e01a6a9011.png     * uses the time zone data to translate between locale and GMT time.

df37983f39daa189b8c814e01a6a9011.png     * @serial

4a5daaec04350a363f186a4d2c5ed6ce.png*/df37983f39daa189b8c814e01a6a9011.pngstructtimezone _zone;

df37983f39daa189b8c814e01a6a9011.png

f70a0fde2b51b7dd92a70e712e540cf6.png

edb48e6f68462ea23d9a824f01de40c5.png/**//**

df37983f39daa189b8c814e01a6a9011.png     *  The asctime() and mktime() functions both take an argument

df37983f39daa189b8c814e01a6a9011.png     *  representing  broken-down time which is a binary represen-

df37983f39daa189b8c814e01a6a9011.png     *  tation separated into year, month, day, etc.   Broken-down

df37983f39daa189b8c814e01a6a9011.png     *  time  is  stored  in  the structure tm which is defined in

df37983f39daa189b8c814e01a6a9011.png     *   as follows:

df37983f39daa189b8c814e01a6a9011.png     *  

df37983f39daa189b8c814e01a6a9011.png     *         struct tm

df37983f39daa189b8c814e01a6a9011.png     *         {

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_sec;         // seconds 

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_min;         // minutes 

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_hour;        // hours 

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_mday;        // day of the month 

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_mon;         // month 

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_year;        // year 

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_wday;        // day of the week 

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_yday;        // day in the year 

df37983f39daa189b8c814e01a6a9011.png     *                 int     tm_isdst;       // daylight saving time 

df37983f39daa189b8c814e01a6a9011.png     *         };

df37983f39daa189b8c814e01a6a9011.png     *  

4a5daaec04350a363f186a4d2c5ed6ce.png*/df37983f39daa189b8c814e01a6a9011.pngstructtm _tm; 

df37983f39daa189b8c814e01a6a9011.png    

0ac3a2d53663ec01c7f7225264eeefae.png}cbef093dcc044b2793832001e2365e43.png

Calendar类定义了很多方法和操作符用来在Time类和时区、年月日等之间转换和设置、读取等。Calendar类实现时间的生成、转换等都是自己实现的,并不调用操作系统的API如mktime()等,并不使用CRT(C运行时)的全局变量如timezone等,所以它是线程安全的,每一个Calendar对象都是互相独立的,拥有自己的时区等信息。

5TimeFormat类

TimeFormat类主要实现了将时间格式化成一个时间文本,可以使用系统缺省的本地格式,也可以指定格式转换。转换的用法如下:

cbef093dcc044b2793832001e2365e43.pngTimeFormat tf("%Y-%m-%d %H:%M:%S.%q");//定义一个格式cbef093dcc044b2793832001e2365e43.pngTime t=Time::getCurrentTime(); 

cbef093dcc044b2793832001e2365e43.pngString s=tf.format(t);//将时间对象格式化成文本字符串

cbef093dcc044b2793832001e2365e43.png

时间格式化pattern有如下几种

%aThe abbreviated weekday name according to the current locale.

%AThe full weekday name according to the current locale.

%bThe abbreviated month name according to the current locale.

%BThe full month name according to the current locale.

%cThe preferred date and time representation for the current locale.

%CThe century number (year/100) as a 2-digit integer. (SU)

%dThe day of the month as a decimal number (range 01 to 31).

%DEquivalentto%m/%d/%y. (Yecch - for Americans only.

Americans should note that in other countries

%d/%m/%y is rather common. This means that in international context

thisformatisambiguousand should not be used.) (SU)

%eLike %d, the day of the month as a decimal number, but a leading

zero is replaced by a space. (SU)

%EModifier: use alternative format, see below. (SU)

%GTheISO8601 year with century as a decimal number.The 4-digit

year corresponding to the ISO week number (see %V).This has the

same format and value as %y,exceptthatiftheISOweeknumber

belongs to the previous or next year, that year is used instead. (TZ)

%gLike %G, but without century, i.e., with a 2-digit year (00-99). (TZ)

%hEquivalent to %b. (SU)

%HThe hour as a decimal number using a 24-hour clock (range 00 to 23).

%IThe hour as a decimal number using a 12-hour clock (range 01 to 12).

%jThe day of the year as a decimal number (range 001 to 366).

%kThehour (24-hour clock) as a decimal number (range 0 to 23); single

digits are preceded by a blank. (See also %H.) (TZ)

%lThe hour (12-hour clock) as a decimal number (range 1 to 12); single

digits are preceded by ablank. (See also %I.) (TZ)

%mThe month as a decimal number (range 01 to 12).

%MThe minute as a decimal number (range 00 to 59).

%nA newline character. (SU)

%OModifier: use alternative format, see below. (SU)

%pEither`AM'or `PM' according to the given time value, or the

corresponding strings for the current locale.Noon is treated as `pm'

and midnight as `am'.

%PLike %p but in lowercase: `am' or `pm' or a corresponding string for

the current locale. (GNU)

%rThe time in a.m. or p.m. notation.In the POSIX locale this is

equivalent to `%I:%M:%S %p'. (SU)

%RThe time in 24-hour notation (%H:%M). (SU) For a version including the

seconds, see %T below.

%sThe number of seconds since the Epoch, i.e., since 1970-01-01 00:00:00 UTC.

(TZ)

%SThe second as a decimal number (range 00 to 61).

%tA tab character. (SU)

%TThe time in 24-hour notation (%H:%M:%S). (SU)

%uThe day of the week as a decimal, range 1 to 7, Monday being 1.

See also %w. (SU)

%UThe week number of the current year as a decimal number, range 00 to 53,

starting with the first Sun? day as the first day of week 01.

See also %V and %W.

%VTheISO8601:1988 week number of the current year as a decimal number,

range 01 to 53, where week 1 is the first week that has at least 4 days

in the current year, and with Monday as the firstdayof the week.

See also %U and %W. (SU)

%wThe day of the week as a decimal, range 0 to 6, Sunday being 0.See also %u.

%WThe week number of the current year as a decimal number, range 00 to 53,

starting with the first Mon? day as the first day of week 01.

%xThe preferred date representation for the current locale without the time.

%XThe preferred time representation for the current locale without the date.

%yThe year as a decimal number without a century (range 00 to 99).

%YThe year as a decimal number including the century.

%zThe time-zone as hour offset from GMT.Required to emit RFC822-conformant

dates (using "%a, %d %b %Y %H:%M:%S %z"). (GNU)

%ZThe time zone or name or abbreviation.

%+The date and time in date(1) format. (TZ)

%%A literal `%' character.

6TimeParser类

TimeParser类实现与TimeFormat相反的功能,是将一个指定格式的时间文本转换成时间Time对象或Calendar对象,它的设计与TimeFormat类似,目前还未全部完成,只实现了转换Mime时间格式的文本的功能。

示例见上面的Hello World程序。

C++通用框架的设计作者:naven日期:2005-11-9

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值