time.h相关时间用法

time.h相关时间用法
time.h相关时间用法

关键字:UTC(世界标准时间),Calendar Time(日历时间),epoch (时间点),clock tick(时钟计时单元)

1.概念

在C/C++中,对字符串的操作有很多值得注意的问题,同样,C/C++对时间的操作也有许多值得大家注意的地方。下面主要介绍在C/C++中时间和日期的使用方法.

通过学习许多C/C++库,你可以有很多操作、使用时间的方法。但在这之前你需要了解一些“时间”和“日期”的概念,主要有以下几个:

Coordinated Universal Time(UTC):协调世界时,又称为世界标准时间,也就是大家所熟知的格林威治标准时间(Greenwich Mean Time,GMT)。比如,中国内地的时间与UTC的时差为+8,也就是UTC+8。美国是UTC-5。

Calendar Time:日历时间,是用“从一个标准时间点到此时的时间经过的秒数”来表示的时间。这个标准时间点对不同的编译器来说会有所不同,但对一个编译系统来说,这个标准时间点是不变的,该编译系统中的时间对应的日历时间都通过该标准时间点来衡量,所以可以说日历时间是“相对时间”,但是无论你在哪一个时区,在同一时

刻对同一个标准时间点来说,日历时间都是一样的。

epoch:时间点。时间点在标准C/C++中是一个整数,它用此时的时间和标准时间点相差的秒数(即日历时间)来表示。

clock tick:时钟计时单元(而不把它叫做时钟滴答次数),一个时钟计时单元的时间长短是由CPU控制的。一个clock tick不是CPU 的一个时钟周期,而是C/C++的一个基本计时单位。

我们可以使用ANSI标准库中的time.h头文件。这个头文件中定义的时间和日期所使用的方法,无论是在结构定义,还是命名,都具有明显的C语言风格。下面,我将说明在C/C++中怎样使用日期的时间功能。

2.计时

C/C++中的计时函数是clock(),而与其相关的数据类型是clock_t。在MSDN中,查得对clock函数定义如下:

clock_t clock( void );

这个函数返回从“开启这个程序进程”到“程序中调用clock()函数”

时之间的CPU时钟计时单元(clock tick)数,在MSDN中称之为挂钟时间(wall-clock)。其中clock_t是用来保存时间的数据类型,在time.h文件中,我们可以找到对它的定义:

#ifndef _CLOCK_T_DEFINED

typedef long clock_t;

#define _CLOCK_T_DEFINED

#endif

很明显,clock_t是一个长整形数。在time.h文件中,还定义了一个常量CLOCKS_PER_SEC,它用来表示一秒钟会有多少个时钟计时单元,其定义如下:

#define CLOCKS_PER_SEC ((clock_t)1000)

可以看到可以看到每过千分之一秒(1毫秒),调用clock()函数返回的值就加1。下面举个例子,你可以使用公式clock()/CLOCKS_PER_SEC来计算一个进程自身的运行时间:

void elapsed_time()

{

printf("Elapsed time:%u secs.\n",clock()/CLOCKS_PER_SEC);

当然,你也可以用clock函数来计算你的机器运行一个循环或者处理其它事件到底花了多少时间:

#i nclude “stdio.h”

#i nclude “stdlib.h”

#i nclude “time.h”

int main( void )

{

long i = 10000000L;

clock_t start, finish;

double duration;

/* 测量一个事件持续的时间*/

printf( "Time to do %ld empty loops is ", i );

start = clock();

while( i-- ) ;

finish = clock();

duration = (double)(finish - start) / CLOCKS_PER_SEC; printf( "%f seconds\n", duration );

system("pause");

在笔者的机器上,运行结果如下:

Time to do 10000000 empty loops is 0.03000 seconds

上面我们看到时钟计时单元的长度为1毫秒,那么计时的精度也为1毫秒,那么我们可不可以通过改变CLOCKS_PER_SEC的定义,通过把它定义的大一些,从而使计时精度更高呢?通过尝试,你会发现这样是不行的。在标准C/C++中,最小的计时单位是一毫秒。

3.与日期和时间相关的数据结构

在标准C/C++中,我们可通过tm结构来获得日期和时间,tm结构在time.h中的定义如下:

#ifndef _TM_DEFINED

struct tm {

int tm_sec; /* 秒–取值区间为[0,59] */

int tm_min; /* 分 - 取值区间为[0,59] */

int tm_hour; /* 时 - 取值区间为[0,23] */

int tm_mday; /* 一个月中的日期 - 取值区间为

[1,31] */

int tm_mon; /* 月份(从一月开始,0代表一月)- 取值区间为[0,11] */

int tm_year; /* 年份,其值等于实际年份减去1900 */

int tm_wday; /* 星期–取值区间为[0,6],其中0代表星期天,1代表星期一,以此类推 */

int tm_yday; /* 从每年的1月1日开始的天数–取值区间为[0,365],其中0代表1月1日,1代表1月2日,以此类推 */

int tm_isdst; /* 夏令时标识符,实行夏令时的时候,tm_isdst为正。不实行夏令时的进候,tm_isdst为0;不了解情况时,tm_isdst()为负。*/

};

#define _TM_DEFINED

#endif

ANSI C标准称使用tm结构的这种时间表示为分解时间(broken-down time)。

而日历时间(Calendar Time)是通过time_t数据类型来表示的,用time_t表示的时间(日历时间)是从一个时间点(例如:1970年1

月1日0时0分0秒)到此时的秒数。在time.h中,我们也可以看到time_t是一个长整型数:

#ifndef _TIME_T_DEFINED

typedef long time_t; /* 时间值 */

#define _TIME_T_DEFINED /* 避免重复定义 time_t */

#endif

大家可能会产生疑问:既然time_t实际上是长整型,到未来的某一天,从一个时间点(一般是1970年1月1日0时0分0秒)到那时的秒数(即日历时间)超出了长整形所能表示的数的范围怎么办?对time_t数据类型的值来说,它所表示的时间不能晚于2038年1月18日19时14分07秒。为了能够表示更久远的时间,一些编译器厂商引入了64位甚至更长的整形数来保存日历时间。比如微软在Visual C++中采用了__time64_t数据类型来保存日历时间,并通过_time64()函数来获得日历时间(而不是通过使用32位字的time()函数),这样就可以通过该数据类型保存3001年1月1日0时0分0秒(不包括该时间点)之前的时间。

在time.h头文件中,我们还可以看到一些函数,它们都是以time_t 为参数类型或返回值类型的函数:

double difftime(time_t time1, time_t time0);

time_t mktime(struct tm * timeptr);

time_t time(time_t * timer);

char * asctime(const struct tm * timeptr);

char * ctime(const time_t *timer);

此外,time.h还提供了两种不同的函数将日历时间(一个用time_t

表示的整数)转换为我们平时看到的把年月日时分秒分开显示的时间

格式tm:

struct tm * gmtime(const time_t *timer); struct tm * localtime(const time_t * timer);

通过查阅MSDN,我们可以知道Microsoft C/C++ 7.0中时间点的值

(time_t对象的值)是从1899年12月31日0时0分0秒到该时间

点所经过的秒数,而其它各种版本的Microsoft C/C++和所有不同版

本的Visual C++都是计算的从1970年1月1日0时0分0秒到该时

间点所经过的秒数。

4.与日期和时间相关的函数及应用

在本节,我将向大家展示怎样利用time.h中声明的函数对时间进行

操作。这些操作包括取当前时间、算时间间隔、以不同的形式显示时

间等内容。

4.1 获得日历时间

我们可以通过time()函数来获得日历时间(Calendar Time),其原型为:

time_t time(time_t * timer);

如果你已经声明了参数timer,你可以从参数timer返回现在的日历时间,同时也可以通过返回值返回现在的日历时间,即从一个时间点(例如:1970年1月1日0时0分0秒)到现在此时的秒数。如果参数为空(NULL),函数将只通过返回值返回现在的日历时间,比如下面这个例子用来显示当前的日历时间:

#i nclude "time.h"

#i nclude "stdio.h"

int main(void)

{

struct tm *ptr;

time_t lt;

lt =time(NULL);

printf("The Calendar Time now is %d\n",lt);

return 0;

}

运行的结果与当时的时间有关,我当时运行的结果是:

The Calendar Time now is 1122707619

其中1122707619就是我运行程序时的日历时间。即从1970年1月1

日0时0分0秒到此时的秒数。

4.2 获得日期和时间

这里说的日期和时间就是我们平时所说的年、月、日、时、分、秒等

信息。从第2节我们已经知道这些信息都保存在一个名为tm的结构

体中,那么如何将一个日历时间保存为一个tm结构的对象呢?

其中可以使用的函数是gmtime()和localtime(),这两个函数的原型

为:

struct tm * gmtime(const time_t *timer); struct tm * localtime(const time_t * timer);

其中gmtime()函数是将日历时间转化为世界标准时间(即格林尼治时间),并返回一个tm结构体来保存这个时间,而localtime()函数是将日历时间转化为本地时间。比如现在用gmtime()函数获得的世界标准时间是2005年7月30日7点18分20秒,那么我用localtime()函数在中国地区获得的本地时间会比时间标准时间晚8个小时,即2005年7月30日15点18分20秒。下面是个例子:

#i nclude "time.h"

#i nclude "stdio.h"

int main(void)

{

struct tm *local;

time_t t;

t=time(NULL);

local=localtime(&t);

printf("Local hour is: %d\n",local->tm_hour);

local=gmtime(&t);

printf("UTC hour is: %d\n",local->tm_hour);

return 0;

}

运行结果是:

Local hour is: 15

UTC hour is: 7

4.3 固定的时间格式

我们可以通过asctime()函数和ctime()函数将时间以固定的格式显示出来,两者的返回值都是char*型的字符串。返回的时间格式为:

星期几月份日期时:分:秒年\n\0

例如:Wed Jan 02 02:03:55 1980\n\0

其中\n是一个换行符,\0是一个空字符,表示字符串结束。下面是两个函数的原型:

char * asctime(const struct tm * timeptr);

char * ctime(const time_t *timer);

其中asctime()函数是通过tm结构来生成具有固定格式的保存时间信息的字符串,而ctime()是通过日历时间来生成时间字符串。这样的话,asctime()函数只是把tm结构对象中的各个域填到时间字符串的相应位置就行了,而ctime()函数需要先参照本地的时间设置,

把日历时间转化为本地时间,然后再生成格式化后的字符串。在下面,如果lt是一个非空的time_t变量的话,那么:

printf(ctime(&It));

等价于:

struct tm *ptr;

ptr=localtime(&It);

printf(asctime(ptr));

那么,下面这个程序的两条printf语句输出的结果就是不同的了(除非你将本地时区设为世界标准时间所在的时区):

#i nclude "time.h"

#i nclude "stdio.h"

int main(void)

{

struct tm *ptr;

time_t lt;

lt =time(NULL);

ptr=gmtime(&It);

printf(asctime(ptr));

printf(ctime(&It));

return 0;

}

运行结果:

Sat Jul 30 08:43:03 2005

Sat Jul 30 16:43:03 2005

4.4 自定义时间格式

我们可以使用strftime()函数将时间格式化为我们想要的格式。它的原型如下:

size_t strftime(

char *strDest,

size_t maxsize,

const char *format,

const struct tm *timeptr

);

我们可以根据format指向字符串中格式命令把timeptr中保存的时间信息放在strDest指向的字符串中,最多向strDest中存放maxsize 个字符。该函数返回向strDest指向的字符串中放置的字符数。

函数strftime()的操作有些类似于sprintf():识别以百分号(%)开始的格式命令集合,格式化输出结果放在一个字符串中。格式化命令说明串strDest中各种日期和时间信息的确切表示方法。格式串中的其他字符原样放进串中。格式命令列在下面,它们是区分大小写的。

%a 星期几的简写

%A 星期几的全称

%b 月分的简写

%B 月份的全称

%c 标准的日期的时间串

%C 年份的后两位数字

%d 十进制表示的每月的第几天

%D 月/天/年

%e 在两字符域中,十进制表示的每月的第几天

%F 年-月-日

%g 年份的后两位数字,使用基于周的年

%G 年分,使用基于周的年

%h 简写的月份名

%H 24小时制的小时

%I 12小时制的小时

%j 十进制表示的每年的第几天

%m 十进制表示的月份

%M 十时制表示的分钟数

%n 新行符

%p 本地的AM或PM的等价显示

%r 12小时的时间

%R 显示小时和分钟:hh:mm

%S 十进制的秒数

%t 水平制表符

%T 显示时分秒:hh:mm:ss

%u 每周的第几天,星期一为第一天(值从0到6,星期一为0)%U 第年的第几周,把星期日做为第一天(值从0到53)

%V 每年的第几周,使用基于周的年

%w 十进制表示的星期几(值从0到6,星期天为0)

%W 每年的第几周,把星期一做为第一天(值从0到53)

%x 标准的日期串

%X 标准的时间串

%y 不带世纪的十进制年份(值从0到99)

%Y 带世纪部分的十制年份

%z,%Z 时区名称,如果不能得到时区名称则返回空字符。

%% 百分号

如果想显示现在是几点了,并以12小时制显示,就象下面这段程序:

#include "time.h"

#include "stdio.h"

int main(void)

{

struct tm *ptr;

time_t lt;

char str[80];

lt=time(NULL);

ptr=localtime(&It);

strftime(str,100,"It is now %I %p",ptr);

printf(str);

return 0;

}

其运行结果为:

It is now 4PM

而下面的程序则显示当前的完整日期:

#include "time.h"

#include "stdio.h"

void main( void )

{

struct tm *newtime;

char tmpbuf[128];

time_t lt;

It=time( NULL );

newtime=localtime(&It);

strftime( tmpbuf, 128, "Today is %A, day %d of %B in the year %Y.\n", newtime);

printf(tmpbuf);

}

运行结果:

Today is Saturday, day 30 of July in the year 2005.

4.5 计算持续的时间长度

有时候在实际应用中要计算一个事件持续的时间长度,比如计算打字速度。在第1节计时部分中,我已经用clock函数举了一个例子。Clock()函数可以精确到毫秒级。同时,我们也可以使用difftime()函数,但它只能精确到秒。该函数的定义如下:

double difftime(time_t time1, time_t time0);

虽然该函数返回的以秒计算的时间间隔是double类型的,但这并不说明该时间具有同double一样的精确度,这是由它的参数决定的(time_t是以秒为单位计算的)。比如下面一段程序:

#include "time.h"

#include "stdio.h"

#include "stdlib.h"

int main(void)

{

time_t start,end;

start = time(NULL);

system("pause");

end = time(NULL);

printf("The pause used %f seconds.\n",difftime(end,start));//<-

system("pause");

return 0;

}

运行结果为:

请按任意键继续. . .

The pause used 2.000000 seconds.

请按任意键继续. . .

可以想像,暂停的时间并不那么巧是整整2秒钟。其实,你将上面程序的带有“//<-”注释的一行用下面的一行代码替换:

printf("The pause used %f seconds.\n",end-start); ?

其运行结果是一样的。

4.6 分解时间转化为日历时间

这里说的分解时间就是以年、月、日、时、分、秒等分量保存的时间结构,在C/C++中是tm结构。我们可以使用mktime()函数将用tm 结构表示的时间转化为日历时间。其函数原型如下:

at,in与on的用法区别

at, in与on的用法区别 1. 表示时间,注意以下用法: ①表示时间的某一点、某一时刻或年龄等用at: I get up at six in the morning. 我早上六点钟起床。 He got married at the age of 25. 他25 岁结婚。 ②泛指一般意义的上午、下午或晚上以及月或年等较长的时间,一般用in:We watch TV in the evening. 我们晚上看电视。 He went to Japan in 1946. 他于1946 去了日本。 ③若表示星期几或某一特定的日期,则用on: He left here on the fifth of May. 他于5 月5 日离开这儿。 2. 表示地点、场所、位置等,注意以下用法: ①表示某一点位置,用at: We live at No 87 Beijing Road. 我们住在北京路87 号。 The hospital is at the end of the street. 医院在这条街的尽头。 与名词所有格连用表示地点,也用at。如: at my sister’s 在我姐姐家 at the doctor’s 在医务室 ②表示空间或范围,用in: What’s in the box? 这盒子里有什么? He lives in Paris with his wife. 他同他妻子住在巴黎。 但有时两者可换用:

The meeting was held at [in] the hotel. 会议在宾馆举行。 ③at与in的另一个区别是:at多用于指较小的地方,而in多用于指较大的地方:in Shanghai 在上海at the station 在车站 ④介词on 用于地点,主要指在某物的表面: What’s on the table? 桌上有什么? There’s a wallet lying on the ground. 地上有个钱包。 【注】在少数搭配中,也用介词on: He works on a farm. 他在农场工作。 3. 在某些搭配中,三者的区别与英国英语和美国英语有关: in the street (英) / on the street (美) 在街上 in the road (英) / on the road (美) 在路上 in the team (英) / on the team (美) 在这个队 at the weekend (英) / on the weekend (美) 在周末 at weekends (英) / on weekends (美) 在周末 4. 有时三者的差别与搭配习惯和用法有关: in bed / on the bed 在床上 in the tree (多指树外之物) / on the tree (多指树本身之物) 在树上

英语时间介词的用法

英语时间介词的用法 表示时间的介词 1)in ,on, at 在……时 一.in, on在方位名词前的区别 1.in表示A地在B地范围之内.如: Taiwan is in the southeast of China. 2.on表示A地与B地接壤、毗邻.如: North Korea is on the east of China. 二.at, in, on在表示时间上的区别 1.at指时间表示: (1)时间的一点、时刻等.如: They came home at sunrise (at noon, at midnight, at ten o’clock, at daybreak,at dawn). (2)较短暂的一段时间.可指某个节日或被认为是一年中标志大事的日子.如:He went home at Christmas (at New Year, at the Spring Festival, at night). 2.in指时间表示: (1)在某个较长的时间(如世纪、朝代、年、月、季节以及泛指的上午、下午或傍晚等)内.如: in 2004,in March, in spring, in the morning, in the evening, etc (2)在一段时间之后.一般情况下,用于将来时,谓语动词为瞬间动词,意为“在……以后”.如: He will arrive in two hours.

谓语动词为延续性动词时,in意为“在……以内”.如: These products will be produced in a month. 注意:after用于将来时间也指一段时间之后,但其后的时间是“一点”,而不是“一段”.如: He will arrive after two o’clock. 3.on指时间表示: (1)具体的时日和一个特定的时间,如某日、某节日、星期几等.如: On Christmas Day(On May 4th),there will be a celebration. (2)在某个特定的早晨、下午或晚上.如: He arrived at 10 o’clock on the night of the 5th. (3)准时,按时.如: If the train should be on time,I should reach home before dark. 三.at,in和on表示地点时的区别 1.at表示地点: (1)用于指较小的地方.如: I shall wait for you at the station. (2)用于门牌号码前.如: He lives at 115 Zhongshan Road. 2.in表示地点: (1)用于指较大的地方.如: He lives in Shanghai. (2)虽然是很小的地方,如果说话人住在那里,也可用in.商店、学校、机关等,

in on at的时间用法和地点用法 完全版

in,on,at的时间用法和地点用法 一、in, on, at的时间用法 ①固定短语: in the morning/afternoon/evening在早晨/下午/傍晚, at noon/night在中午/夜晚, (不强调范围,强调的话用during the night) early in the morning=in the early morning在大清早, late at night在深夜 on the weekend在周末(英式用at the weekend在周末,at weekends每逢周末) on weekdays/weekends在工作日/周末, on school days/nights在上学日/上学的当天晚上, ②不加介词 this, that, last, next, every, one, yesterday, today, tomorrow, tonight,all,most等之前一般不加介词。如, this morning 今天早晨 (on)that day在那天(that day更常用些) last week上周 next year明年 the next month第二个月(以过去为起点的第二个月,next month以现在为起点的下个月) every day每天 one morning一天早晨 yesterday afternoon昨天下午 tomorrow morning明天早晨 all day/morning/night整天/整个早晨/整晚(等于the whole day/morning/night) most of the time (在)大多数时间 ③一般规则 除了前两点特殊用法之外,其他≤一天,用on,>一天用in,在具体时刻或在某时用at(不强调时间范围) 关于on 生日、on my ninth birthday在我九岁生日那天 节日、on Teachers’Day在教师节 (注意:节日里有表人的词汇先复数再加s’所有格,如on Children’s Day, on Women’s Day, on Teachers Day有四个节日强调单数之意思,on Mother’s Day, on Father’s Day, on April Fool’s Day, on Valenti Day) 星期、on Sunday在周日,on Sunday morning在周日早晨 on the last Friday of each month 在每个月的最后一个星期五 日期、on June 2nd在六月二日 on the second (of June 2nd) 在六月的第二天即在六月二日 on the morning of June 2nd在六月二日的早晨,on a rainy morning在一个多雨的早晨 on a certain day 在某天 on the second day在第二天(以过去某天为参照) 注意:on Sunday在周日,on Sundays每逢周日(用复数表每逢之意),every Sunday每个周日,基本一个意思。 on a school day 在某个上学日,on school days每逢上学日。on the weekend在周末,on weekends每逢 周末。 关于in in June在六月 in June, 2010在2010年六月

in on at for表示时间时的用法区别

1 at (在、于)用指明一特定的时间、节日、年龄: 1.1 at dawn/ at night/ at noon/ at midnight /at daybreak 在黎明/在夜里/在中午/在午夜/在日出时 1.2 I go to school at seven in the morning. (at seven) 我早上七点钟去上学。 1.3 at half past five (五点过半小时) 在五点半 1.4 at a quarter to seven (过四分之一小时就到七点) 六点四十五分 1.5 The train is due at 1 2.15 p.m. (at 12.15p.m.) 那班火车的到站时间是12点15分。 1.6 at mid-autumn festival/ at Christmas / at Spring Festival 在中秋节/ 在圣诞节/在春节 7. at forty 在四十岁时 2 in (在、在…之内、在…期间、在…后、过…后) 指明:天、年、月、季节、周次: 2.1 in the morning 在早上(不可说at the morining。鬼才知道为什么不可用at, 大约因为at 没有“在…期间”的意思吧) 2.2 in the afternoon 在下午(在下午这段期间,呵呵,举一反三喔) 2.3 She likes to work in the evening. (或in the night) 她喜欢在晚上工作 2.4 in the day time 在白天 2.5 in 2002 (2002可读作two thousand two) 在2002年 2.6 He's to quit in May. (in May)他在五月就辞职了。 2.7 He went to Tokyo in June 2002. (in June 2002)他于2002年六月去东京。 2.8 in the second week of July 在七月份的第二周 2.9 It's too cold in winter to run outside. (in winter) 冬天里出外跑步是太 冷了。 2.10 in two months 在两个月内 2.11 in those days 在当时 3 on (在…时、在(某日)、在某日早/午/晚、当…时候、和…同时、刚一…) 指明:日子、日期、星期加上早午晚 3.1 on the first 在一号(指某月一号,如二号要说second等。其实意思是指某月的第几天) 3.2 We're having a party on the fifth of June. (或on June the fifth) 我们会在六月五日举行一个晚会。 3.3 on July the third 1990 在1990年7月3日 3.4 My brother is coming on Sunday. (on Sunday) 我的哥哥会在星期天来。 3.5 on Sunday morning /afternoon 在星期天早上/下午 3.6 on Friday evening 在星期五晚上 3.7 on the next morning 隔天早上 3.8 on the following afternoon 在下一个傍晚 3.9 on the night before 在前一个晚上 3.10 on the morning of 5th 在五号的早上

In on at 时间用法及练习

In\ on\ at (time) at 用在具体某一时刻eg at 11:00 at 4:30 在节假日的全部日子里at Christmas 习惯用法at noon at weekends\ at the weekend at night at breakfast\lunch\supper on 具体到某一天;某一天的早晨,中午或晚上on May the first on Sunday morning 对具体某一天的早晨,中午,晚上进行详细的描述on a sunny morning on a windy night 节日的当天;星期on Women?s Day on Monday In 用在年;月;季节in spring in 2012 in August 后面+一段时间表示将来时in two days 习惯用法in the morning\in the afternoon\in the evening “\”以this, that, last, next, some, every, one, any,all开始的时间副词之前的at\on\in 省略在today, tomorrow, yesterday, the day after tomorrow, tomorrow morning,yesterday afternoon,the day before yesterday 之前的介词必须省略 Practice ___ summer ____ 2012 ____ supper ___ 4:00 ___ June the first ___yesterday morning ____ New Year?s Day ___ Women?s Day ___ the morning ____ the morning of July the first ____ 2014 ___ tomorrow morning ____ midnight 1.—What are you doing ____ Sunday? And what is your wife doing ___ the weekend? 2. He?ll see you ____ Monday. And he…ll see your brother ____next Monday. 3. They often go out ___ the evenings. But they don?t go out ____ Sunday evenings. 4. Do you work ____ Fridays? Does she work _____ every Friday? 5. They usually have a long holiday ___ summer. But their son can only have a short holiday ___ Christmas. 6. Paul got married ___ 2010, He got married ___ 9 o?clock ___ 19 May 2010. His brother got married ___ May, 2011. His sister is getting married ___ this year. 1.—When will Mr Black come to Beijing? ---_______ September 5 A. on B. to C. at D. in 2. The twins were born ____ a Friday evening. A. on B. of C. at D. in 3. It?s the best time to plant ____ spring. A. on B. in C. at D.\ 4. ____ the age of twelve, Edison began selling newspaper on train. A. On B. At C. In D.By 5. She has been an English teacher ____ 2000. A. for B. since C. in D.on 6.I have studied English _____ 2003. A. since B. for C. from D.in

2时间介词in,on,at的用法

介词in on at 表示时间的用法及区别 Step1 Teaching Aims 教学生掌握时间介词in,on和at的区别及用法。 Step2 Teaching Key and Difficult Points 教学生掌握时间介词in,on和at的区别及用法。 Step3 Teaching Procedures 1.用in的场合后所接的都是较长时间 (1)表示“在某世纪/某年代/特定世纪某年代/年/季节/月”这个含义时,须用介词in Eg: This machine was invented in the eighteenth century. 这台机器是在18世纪发明的。 、 She came to this city in 1980. 他于1980年来到这个城市。 It often rains here in summer. 夏天这里常常下雨。 (2)表示“从现在起一段时间以后”时,须用介词in。(in+段时间表将来) Eg: They will go to see you in a week. 他们将在一周后去看望你。

I will be back in a month. 我将在一个月后回来。 (3)泛指一般意义的上、下午、晚上用in, in the morning / evening / afternoon Eg: They sometimes play games in the afternoon. 他们有时在下午做游戏。 Don't watch TV too much in the evening. 晚上看电视不要太多。(4)A. 当morning, evening, afternoon被of短语修饰,习惯上应用on, 而不用in. Eg: on the afternoon of August 1st & B. 但若前面的修饰词是early, late时,虽有of短语修饰,习惯上应用in, 而不用on. Eg: in the early morning of September 10th 在9月10的清晨; Early in the morning of National Day, I got up to catch the first bus to the zoo. 国庆节一清早,我便起床去赶到动物园的第一班公共汽车。 2.用on的场合后所接的时间多与日期有关 (1)表示“在具体的某一天”或(在具体的某一天的)早上、中午、晚上”,或“在某一天或某一天的上午,下午,晚上”等,须用介

初中英语时间介词的用法及辨异

时间介词的用法及辨异 表示时间的介词,在英语介词中占着相当重要的位置。在初中阶段英语教学过程中,已出现了许多用来表示时间的介词。其中有:at on in during for to till un til after by before等。本文着重谈一谈这些介词在表示时间的用法及它们之间的同异之处。 1.at on in a)at用来表示时间时,通常指时间的某一点。例如:at five o’clock atnoon atmidnight b)on用来表示某一段时间,特指某天或某天的上午下午或晚上。例如:on Sunday,on October,on Saturday morning. c)in也可用来表示一段时间,但多指长于一天或不到一天的时间段。例如:inJanuary,insummer, in1988, in the morning ,in the evening. 2.in与during a)during用来表示一段时间,其意义大致相当于in的用法。一般来说,凡是能用in的地方,也可以用during.例如:He came to see me during my absence.Don’t go to see his wife in his absence. B)during与in的区别在于during强调时间的延续性,而in则只是一般指某一时间。试比较:They visited many cities during their stay in China.Her grandpa was killed in the war. 3.in for during a)“in+时间”与“for+时间”都可表示一段时间,但“for+时间”表示“有多久”,而“in+时间”则表示“在何时”。例如:We worked there for the winter.They worked there in winter.

介词in-on-at在表示时间时的用法

介词in, on, at在表示时间时的用法区别 ①in时间范围大(一天以上)如:in Tanuary, in winter, in 1999;泛指在上午,下午,晚上,如:in the morning(afternoon, evening). 习惯用法:in the daytime 在白天。 ②on指在某一天或某一天的上午,下午,晚上,如:on Monday, on Sunday afternoon, on July 1, 1999 ③at时间最短,一般表示点时间,如at six o’clock, at three thirty.习惯用法:at night, at noon, at this time of year. in, on和at在表达时间方面的区别 in 表示在某年、某季节、某月、某周、某天和某段时间 in a year在一年中 in spring 在春季 in September 在九月 in a week 在一周中 in the morning/afternoon/evening 在上午/下午/傍晚 但在中午,在夜晚则用at noon/night on 表示某一天或某一天的某段时间 on Monday 在周一 on Monday afternoon 在周一下午 on March 7th 在3月7日 on March 7th, 1998. 在1998年3月7日 on the morning of March 7th, 1998. 在1998年3月7日上午

at 表示某个具体时刻。 at eight o’clock 在8点钟 at this time of the year 在一年中的这个时候 at the moment 在那一时刻 at that time 在那时 注意:在英语中,如果时间名词前用this, last, next 等修饰时,像这样的表示,“在某时”的时间短语前,并不需要任何介词。 例如:last month, last week, this year, this week, next year, the next day, the next year 等。 1.What’s the weather like in spring/summer/autumn/winter in your country? 你们国家春天/夏天/秋天/冬天的天气怎么样? in 在年、月、周较长时间内 in a week 在里面 in the room 用某种语言 in English 穿着 in red on 某日、某日的上下午on Sunday afternoon 在……上面 on the desk 靠吃……为生live on rice 关于 a book on Physics 〔误〕We got to the top of the mountain in daybreak. 〔正〕We got to the top of the mountain at day break. 〔析〕at用于具体时刻之前,如:sunrise, midday, noon, sunset, midnight, night。〔误〕Don't sleep at daytime 〔正〕Don't sleep in daytime. 〔析〕in 要用于较长的一段时间之内,如:in the morning / afternoon, 或in the week / month / year. 或in spring / supper /autumn / winter等等。 〔误〕We visited the old man in Sunday afternoon. 〔正〕We visited the old man on Sunday afternoon. 〔析〕in the morning, in the afternoon 如果在这两个短语中加入任何修饰词其前面的介

介词at,in与on在时间方面的用法辨析

介词at,in与on在时间方面的用法辨析 at表示时间的一点;in表示一个时期;on表示特殊日子。如:He goes to school at seven o’clock in the morning. 他早晨七点上学。 Can you finish the work in two days. 你能在两天内完成这个工作吗? Linda was born on the second of May. 琳达五月二日出生。 1. at后常接几点几分,天明,中午,日出,日落,开始等。如: at five o’clock (五点),at down (黎明),at daybreak (天亮),at sunrise (日出),at noon (中午),at sunset (日落),at midnight (半夜),at the beginning of the month (月初),at that time (那时),at that moment (那会儿),at this time of day (在一天的这个时候)。 2. in后常接年,月,日期,上午,下午,晚上,白天,季节,世纪等。如: in 2006(2006年),in May,2004 (2004年五月),in the morning (早晨/上午),in the afternoon (下午),in the evening (晚上),in the night (夜晚),in the daytime (白天),in the 21st century (21世纪),in three days (weeks/month)三天(周/个月),in a week (一周),in spring (春季)。 3. on后常接某日,星期几,某日或某周日的朝夕,节日等。如: on Sunday (星期日),on a warm morning in April (四月的一个温暖的上午),on a December night (12月的一个夜晚),on that afternoon (那天下午),on the following night (下一个晚上),on Christmas afternoon (圣诞节下午),on October 1,1949 (1949年10月1日),on New Year’s Day (新年),on New Ye ar’s Eve (除夕),on the morning of the 15th (15日的早上)等。

in-on-at-的用法区别

in on at 的用法区别 一. in,on在方位名词前的区别 1. in表示A地在B地范围之内。如: Taiwan is in the southeast of China. 台湾在中国的东南部。 2. on表示A地与B地接壤、毗邻。如: North Korea is on the east of China. 朝鲜在中国的东部。 二. at, in, on在表示时间上的区别 1. at指时间表示: (1)时间的一点、时刻等。如: They came home at sunrise. 他们在黎明回到家. (at noon, at midnight, at ten o’clock, at daybreak, at dawn). (2)较短暂的一段时间。可指某个节日或被认为是一年中标志大事的日子。如:He went home at Christmas (at New Year, at the Spring Festival, at night). 2. in指时间表示: (1)在某个较长的时间(如世纪、朝代、年、月、季节以及泛指的上午、下午或傍晚等)内。如: in 2004, in March, in spring, in the morning, in the evening (2)在一段时间之后。一般情况下,用于将来时,谓语动词为瞬间动词,意为 “在……以后”。如: He will arrive in two hours. 他将在两小时内到达。 (3)谓语动词为延续性动词时,in意为“在……以内”。如: These products will be produced in a month.这些产品将在一个月内生产。 注意:after用于将来时间也指一段时间之后,但其后的时间是“一点”,而不是“一段”。如: He will arrive after two o’clock. 他将两点钟后到。 3. on指时间表示: (1)具体的时日和一个特定的时间,如某日、某节日、星期几等。如:On Christmas Day(On May 4th), there will be a celebration. 在5月4号将会有一个庆祝活动。 (2)在某个特定的早晨、下午或晚上。如: He arrived at 10 o’clock on the night of the 5th. 他5日晚10点到达。

inonat的时间用法和地点用法版

精心整理in,on,at的时间用法和地点用法 一、in,on,at的时间用法 1、固定短语: inthemorning/afternoon/evening在早晨/下午/傍晚, 2 (on thenextmonth第二个月(以过去为起点的第二个月,nextmonth以现在为起点的下个月) everyday每天 onemorning一天早晨 yesterdayafternoon昨天下午

tomorrowmorning明天早晨 allday/morning/night整天/整个早晨/整晚(等于thewholeday/morning/night)mostofthetime(在)大多数时间 3、一般规则 除了前两点特殊用法之外,其他≤一天,用on,>一天用in,在具体时刻或在某时用at(不强调时间范围) 关于 On 1 2) 3) (注意:节日里有表人的词汇先复数再加s’所有格,如 onChildren’sDay,onWomen’sDay,onTeachers’Day有四个节日强调单数之意思,onMother’sDay,onFather’sDay,onAprilFool’sDay,onValentine’sDay) 星期、onSunday在周日,onSundaymorning在周日早晨onthelastFridayofeachmonth在每个月的最后一个星期五

日期、onJune2nd在六月二日 onthesecond(ofJune2nd)在六月的第二天即在六月二日onthemorningofJune2nd在六月二日的早晨,onarainymorning在一个多雨的早晨 onacertainday在某天 onthesecondday在第二天(以过去某天为参照) 关于 In 1 2) InJune在六月 inJune,2010在2010年六月 in2010在2010年 inamonth/year在一个月/年里(在将来时里翻译成一个月/年之后) inspring在春天

inonat的用法及区别

:早、午、晚、阳光、灯、影、衣、帽…… At:黎明、午夜、点与分,年、月、年月、季节、周,将来时态……In:以后…… (小处at大处in 有形with无形by 语言、单位、材料in) [特征、方面与方式,心情成语惯用in 介词at和to表方向] 2.On:日子、日期、年月日,星期加上早、午、晚, 3. 收音、农场、值日,关于、基础、靠、著论, 4. 着、罢、出售、偷、公、假,故意、支付、相反,准 5. (特定时日和“一……就”on后常接动名词) 6. [年、月、日加早、午、晚,of之前on代in] 7.In:cab,carriage 8. At:山脚、门口、在当前,速、温、日落、价、核心 On:步行、驴、马、玩笑 <1.>关于时间 早、午、晚要用“in ” 例: in the afternoon 在下午in the morning 在早上 in the evening 在晚上in the day 在白天 at黎明、午、夜、点与分 例: at dawn /at daybreak 在黎明时候 at night 在夜间at noon 在中午at midnight 在午夜 (以上短语都不用冠词) at nine o'clock 在9点钟 at half past ten 在10点半 at ten thirty . 在上午10点30分 at the weekend 在周末 <2.>关于年、月、年月、季节、周 即在“来年”,在“某月”,在“某年某月”, 但在某年某月某日则用“on”在四季,在第几周等都要用“in” in 1927 在1927年in March 在三月 in July l984 在1984年7月 in the first week of this semester这学期的第一周 in the third week 在第三周in spring 在春季 <3.>关于日子、日期、年月日,星期加上早午晚 (以下皆用“on”) on October the first 1949 1949年10月1日 on May the first 5月1日on the sixteenth 16号

完整word版,关于时间前的介词用法

关于时间前的介词用法 1、介词in用法: 2、介词at的用法: 3、after 表示在什么时间之后。 4、其反义词是before 或ago 表示在什么时间之前 5、介词on的用法:

小学英语介词at,in与on在时间方面的用法 at表示时间的一点;in表示一个时期;on表示特殊日子。 如:He goes to school at seven o’clock in the morning. 他早晨七点上学。 Can you finish the work in two days. 你能在两天内完成这个工作吗? Linda was born on the second of May. 琳达五月二日出生。 1>. at后常接几点几分,天明,中午,日出,日落,开始等。 如:at five o’clock (五点), at down (黎明), at daybreak (天亮), at sunrise (日出), at noon (中午), at sunset (日落), at midnight (半夜), at the beginning of the month (月初), at that time (那时) at that moment (那会儿), at this time of day (在一天的这个时候)。 2>. in后常接年,月,日期,上午,下午,晚上,白天,季节,世纪等。如:in 2006(2006年), in May,2004 (2004年五月), in the morning (早晨/上午), in the afternoon (下午), in the evening (晚上), in the night (夜晚), in the daytime (白天), in the 21st century (21世纪), in three days (weeks/month)三天(周/个月), in a week (一周), in spring (春季)。 3>. on后常接某日,星期几,某日或某周日的朝夕,节日等。 如:on Sunday (星期日), on a warm morning in April (四月的一个温暖的上午), on a December night (12月的一个夜晚), on that afternoon (那天下午), on the following night (下一个晚上), on Christmas afternoon (圣诞节下午), on October 1,1949 (1949年10月1日), on New Year’s Day (新年), on New Year’s Eve (除夕), on the morning of the 15th (15日的早上)等。

inonat的时间用法和地点用法版

i n o n a t的时间用法和 地点用法版 集团档案编码:[YTTR-YTPT28-YTNTL98-UYTYNN08]

i n,o n,a t的时间用法和地点用法 一、in,on,at的时间用法 1、固定短语: inthemorning/afternoon/evening在早晨/下午/傍晚, atnoon/night在中午/夜晚,(不强调范围,强调的话用duringthenight)earlyinthemorning=intheearlymorning在大清早, lateatnight在深夜 ontheweekend在周末(英式用attheweekend在周末,atweekends每逢周末)onweekdays/weekends在工作日/周末, onschooldays/nights在上学日/上学的当天晚上, 2、不加介词 this,that,last,next,every,one,yesterday,today,tomorrow,tonight,all,most等之前一般不加介词。如, thismorning今天早晨 (on)thatday在那天(thatday更常用些) lastweek上周 nextyear明年 thenextmonth第二个月(以过去为起点的第二个月,nextmonth以现在为起点的下个月) everyday每天 onemorning一天早晨 yesterdayafternoon昨天下午 tomorrowmorning明天早晨

allday/morning/night整天/整个早晨/整晚(等于 thewholeday/morning/night) mostofthetime(在)大多数时间 3、一般规则 除了前两点特殊用法之外,其他≤一天,用on,>一天用in,在具体时刻或在某时用at(不强调时间范围) 关于on On指时间表示: 1)具体的时日和一个特定的时间,如某日,某节日,星期几等。Hewillcometomeetusonourarrival. OnMay4th(OnSunday,OnNewYear’sday,OnChristmasDay),therewillbeacelebra tion. 2)在某个特定的早晨,下午或晚上。 Hearrivedat10o’clocko nthenightofthe5th. Hediedontheeveofvictory. 3)准时,按时。 Iftherainshouldbeontime,Ishouldreachhomebeforedark. 生日、onmyninthbirthday在我九岁生日那天 节日、onTeachers’Day在教师节 (注意:节日里有表人的词汇先复数再加s’所有格,如 onChildren’sDay,onWomen’sDay,onTeachers’Day有四个节日强调单数之意思, onMother’sDay,onFather’sDay,onAprilFool’sDay,onValentine’sDay)星期、onSunday在周日,onSundaymorning在周日早晨

介词in-on-at用法与区别

一. in,on在方位名词前的区别 1.in表示A地在B地范围之内。如: Taiwan is in the southeast of China. 2.on表示A地与B地接壤、毗邻。如: North Korea is on the east of China. ※二. at, in, on在表示时间上的区别 1.at指时间表示: (1)时间的一点、时刻等。如: They came home at sunrise (at noon, at midnight, at ten o’clock, at daybreak, at dawn). (2)较短暂的一段时间。可指某个节日或被认为是一年中标志大事的日子。如: He went home at Christmas (at New Year, at the Spring Festival, at night). 2.in指时间表示: (1)在某个较长的时间(如世纪、朝代、年、月、季节以及泛指的上午、下午或傍晚等)内。如: in 2004, in March, in spring, in the morning, in the evening, etc (2)在一段时间之后。一般情况下,用于将来时,谓语动词为瞬间动词,意为“在……以后”。如: He will arrive in two hours. 谓语动词为延续性动词时,in意为“在……以内”。如:

给大家推荐一个英语微信群-Empty Your Cup 英语微信群是目前学习英语最有效的方法,群里都是说英语,没有半个中文,而且规则非常严格,是一个超级不错的英语学习环境,群里有好多英语超好的超牛逼的人,还有鬼佬和外国美眉。其实坦白说,如果自己一个人学习英语太孤独,太寂寞,没有办法坚持,好几次都会半途而废。只要你加入到那个群里以后,自己就会每天都能在群里坚持学,坚持不停地说和练,由于是付费群,群里的成员学习氛围非常强,每天的训练度都非常猛,本来很懒惰的你一下子就被感染了,不由自主地被带动起来参与操练,不好意思偷懒,别人的刻苦学习精神会不知不觉影响你,Empty Your Cup英语微信群(进群加喂新 601332975)可以彻底治好你的拖延症,里面学员都非常友好,总是给你不断的帮助和鼓励,让你在学英语的路上重新燃起了斗志,因为每天都在运用,你的英语口语就能得到了迅猛的提升,现在可以随便给一个话题,都能用英文滔滔不绝的发表5分钟以上对这个话题的看法和观点,想提高英语口语的 可以加入进来,It really works very well.

相关文档
最新文档