试图获得日期细分 [英] Trying to get a Date Breakdown

查看:47
本文介绍了试图获得日期细分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在两个日期获得整体差异,


我可以得到年,月,周,日,小时,分钟的差异,

秒,没有问题...


我似乎无法弄清楚如何获得:


2年,3几个月,一周,三天,14个小时,21个分钟,33个秒。


最难的部分,我无法弄清楚的部分是月份

部分...所有其他部分都是静态的,定义的长度成分,但是月数

变化,都是不同的...


帮助!谁知道你是怎么做到的?我被困了......


非常感谢您的帮助!


Atley

I am trying to get a overall difference on two dates,

I can get the difference in Years, Months, Weeks, Days, Hours, Minutes,
Seconds, no problems...

What I cannot seem to figure out is how to get:

2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds.

The hardest part of that, the part I cannot figure out, is the Month
section... all the others are static, defined length components, but Months
change, are all different...

Help! anyone know how you do this? I am stuck...

Thanks So Much for your Help!

Atley

推荐答案

怎么样才能获得差异。


1,你获得年份差异并减去它

2你得到了月份差异并减去它

3 ....(等等......)


" Atley" <在***** @ hotmail.com>在消息中写道

新闻:OI ************** @ TK2MSFTNGP12.phx.gbl ...
what about getting the difference incerementally.

1st you get the difference in Year and substract it
2nd you get the difference in month and substract it
3rd .... (etc ...)

"Atley" <at*****@hotmail.com> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl...
我想要得到两个日期的整体差异,

我可以得到年,月,周,日,小时,分钟,
秒,没有问题...

2年,3个月,1周,3天,14小时,21分钟,33秒。
最难的部分,我无法弄清楚的部分是月份
部分...所有其他部分都是静态的,定义的长度成分,但是
月份变化,都是不同的......

帮助!谁知道你是怎么做到的?我被卡住了......

非常感谢您的帮助!

Atley
I am trying to get a overall difference on two dates,

I can get the difference in Years, Months, Weeks, Days, Hours, Minutes,
Seconds, no problems...

What I cannot seem to figure out is how to get:

2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds.

The hardest part of that, the part I cannot figure out, is the Month
section... all the others are static, defined length components, but Months change, are all different...

Help! anyone know how you do this? I am stuck...

Thanks So Much for your Help!

Atley



是的,我想到了,但是如何根据总数确定要删除的内容,

基于多少个月?


"劳埃德杜邦 < net.galador@ld>在消息中写道

新闻:eM ************* @ TK2MSFTNGP12.phx.gbl ...
Yeah, I thought of that, but how do I decide what to delete from the total,
based on how many months?

"Lloyd Dupont" <net.galador@ld> wrote in message
news:eM*************@TK2MSFTNGP12.phx.gbl...
如何在实际上获得差异。

1,你在年份中获得差异并减去它
第二,你得到月份的差异并减去它
第三....(等......)

Atley <在***** @ hotmail.com>在消息中写道
新闻:OI ************** @ TK2MSFTNGP12.phx.gbl ...
what about getting the difference incerementally.

1st you get the difference in Year and substract it
2nd you get the difference in month and substract it
3rd .... (etc ...)

"Atley" <at*****@hotmail.com> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl...
我试图获得整体差异两个约会,

我可以在几年,几个月,一周,几天,几小时,几分钟内获得差异,几秒钟,没有问题...

我是什么似乎无法弄清楚如何获得:

2年,3个月,1周,3天,14小时,21分钟,33秒。

最难的部分其中,我无法弄清楚的部分是月份
部分...所有其他部分都是静态的,定义的长度成分,但是
I am trying to get a overall difference on two dates,

I can get the difference in Years, Months, Weeks, Days, Hours, Minutes,
Seconds, no problems...

What I cannot seem to figure out is how to get:

2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds.

The hardest part of that, the part I cannot figure out, is the Month
section... all the others are static, defined length components, but


月份

更改,都不一样......

求助!谁知道你是怎么做到的?我被困了......

非常感谢您的帮助!

Atley
change, are all different...

Help! anyone know how you do this? I am stuck...

Thanks So Much for your Help!

Atley




我没有收到你。


月份有不同的长度或你修改开始或结束日期,

结果应该是相同的(我猜)


喜欢

2月2日(2)2002年 - 1月1日(1)2001

= 1Y +(2001年2月2日 - 2001年1月1日)或1年+(2002年2月2日 - 2002年1月1日)

= 1Y + 1M +(2001年1月2日 - 2001年1月1日) )或1Y + 1M +(2Feb2002-1stFeb2002)

= 1Y + 1M + 1D或1Y + 1M + 1D


不是吗?


" Atley" <在***** @ hotmail.com>在消息中写道

新闻:up ************** @ TK2MSFTNGP10.phx.gbl ...
I don''t get you.

wether month have different lenght or you modify start or end date, the
result should be the same (I guess)

like
2 Feb (2) 2002 - 1st Jan (1) 2001
= 1Y + (2 Feb 2001 - 1st Jan 2001) OR 1 year + (2 Feb 2002 - 1st Jan 2002)
= 1Y + 1M + (2 Jan 2001 - 1st Jan 2001) OR 1Y+1M+(2Feb2002-1stFeb2002)
= 1Y + 1M + 1D OR 1Y + 1M + 1D

isn''t it ?

"Atley" <at*****@hotmail.com> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
是的,我想到了但是,如何根据多少个月决定从
总计中删除什么?


Lloyd Dupont < net.galador@ld>在消息中写道
新闻:eM ************* @ TK2MSFTNGP12.phx.gbl ...
Yeah, I thought of that, but how do I decide what to delete from the total, based on how many months?

"Lloyd Dupont" <net.galador@ld> wrote in message
news:eM*************@TK2MSFTNGP12.phx.gbl...
如何在实际上获得差异。

1,你获得年份差异并减去它
第二,你得到月份的差异并减去它
第三....(等等......)

Atley <在***** @ hotmail.com>在消息中写道
新闻:OI ************** @ TK2MSFTNGP12.phx.gbl ...
what about getting the difference incerementally.

1st you get the difference in Year and substract it
2nd you get the difference in month and substract it
3rd .... (etc ...)

"Atley" <at*****@hotmail.com> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl...
我试图获得整体差异两个约会,

我可以在年,月,周,日,小时,
分钟,秒,没有问题得到差异...

我是什么似乎无法弄清楚如何获得:

2年,3个月,1周,3天,14小时,21分钟,33秒。

最难的部分其中,我无法弄清楚的部分是月份
部分...所有其他部分都是静态的,定义的长度成分,但是
I am trying to get a overall difference on two dates,

I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, Seconds, no problems...

What I cannot seem to figure out is how to get:

2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds.

The hardest part of that, the part I cannot figure out, is the Month
section... all the others are static, defined length components, but


月份

更改,都不一样......

求助!谁知道你是怎么做到的?我被困了......

非常感谢您的帮助!

Atley
change, are all different...

Help! anyone know how you do this? I am stuck...

Thanks So Much for your Help!

Atley





这篇关于试图获得日期细分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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