DateTime地狱 [英] DateTime Hell

查看:55
本文介绍了DateTime地狱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试编写行程计划。


从日期时间选择器获得日期和时间

将其转换为日期变量以提取日期和时间

表单首先有一个文本框,通过

选择器显示开始日期和时间。

接下来的几个文本框允许用户输入小时和已过去的分钟

发生事件的时间

每个文本框从前一个框中减去或添加以显示新日期

time


例如:

开始日期是9/9/2004 2:15:00 AM

我想减去4小时从开始日期起30分钟(一个可更改的用户输入到

文本框)并生成一个新的日期时间(将
转换为字符串并输出到显示) 。


问题:我怎样才能从小时开始借阅会议记录,以及从需要的日期借入

小时。 br />

另外,对于输出显示,是否通常使用文本框或标签

控制输出结果?

Trying to write an itinerary program.

Got date and time from date time picker
Converted it to date variables to extract the date and the time
The form has first a textbox displaying the starting date and time via the
picker.
The next few text boxes allow user input of hours and minutes for elapsed
time of occurring events
Each text box subtracts or adds from the previous box to reveal a new date
time

Example:
The start date is 9/9/2004 2:15:00 AM
I want to subtract 4 hours and 30 minutes (a changeable user input to a
textbox) from the start date and produce a new date time (which is converted
to a string and output to a display).

The problem: How can I get the minutes to borrow from the hours, and the
hours to borrow from the date when that is required.

Also, for the output display, is it typical to use a textbox or a label
control for output results?

推荐答案

你没有做所有那些混乱

使用DateAdd,DateDiff等

- 但如果你正在使用文本框并尝试模拟vb可以

do -

你可以使用整数除法运算符\和Mod运营商将

除以60并获得余额


Dennis D. < TE ** @ dennisys.com>在消息中写道

新闻:%2 *************** @ TK2MSFTNGP10.phx.gbl ...
you don''t have to do all that mess
use DateAdd , DateDiff, etc
--but if you''re working from text boxes and trying to simulate what vb can
do -
you can use the integer division operator "\" and the "Mod" operator to
divide by 60 and get the remainder

"Dennis D." <te**@dennisys.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
试着写行程安排。

从日期时间选择器获取日期和时间
将其转换为日期变量以提取日期和时间
表单首先显示一个显示开始日期的文本框时间通过
选择器。
接下来的几个文本框允许用户输入发生事件的已用时间和时间
每个文本框从前一个框中减去或添加揭示新约会时间

示例:
开始日期是9/9/2004 2:15:00 AM
我想减去4小时从开始日期起30分钟(一个可更改的用户输入到
文本框)并生成一个新的日期时间(
转换为字符串并输出到显示器)。
问题:我怎样才能从上班时间借用会议记录,以及从需要时间起借用的时间。

另外,对于输出显示,是否通常使用文本框或标签
控制输出结果?
Trying to write an itinerary program.

Got date and time from date time picker
Converted it to date variables to extract the date and the time
The form has first a textbox displaying the starting date and time via the
picker.
The next few text boxes allow user input of hours and minutes for elapsed
time of occurring events
Each text box subtracts or adds from the previous box to reveal a new date
time

Example:
The start date is 9/9/2004 2:15:00 AM
I want to subtract 4 hours and 30 minutes (a changeable user input to a
textbox) from the start date and produce a new date time (which is converted to a string and output to a display).

The problem: How can I get the minutes to borrow from the hours, and the
hours to borrow from the date when that is required.

Also, for the output display, is it typical to use a textbox or a label
control for output results?



---

发送邮件经过无病毒认证。

由AVG反病毒系统检查( http://www.grisoft.com)

版本:6.0.732 /病毒库:486 - 发布日期:2004年7月29日


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 7/29/2004


获取用户输入的文本框默认为系统日期,除非我从日期时间选择器克隆日期并添加或减去

小时和分钟。


我还有一个问题:如何让vb借用父母

变量值?


所有混乱都是表格。


谢谢。可以使用更多的输入。


这里是一个URL:
http://www.dennisys.com/physical_science/vb/dates.htm


ed。


" Hal Rosser" < HM ****** @ bellsouth.net>在留言中写道

新闻:lJ ****************** @ bignews6.bellsouth.net ..
The textbox that gets the user input defaults to the system date unless I
clone the date from the date time picker and either add or subtract the
hours and minutes.

I''m still left with the question: How do I get vb to borrow from the parent
variable values?

All that mess is the form.

Thanks. Could use more input.

Here''s a URL:
http://www.dennisys.com/physical_science/vb/dates.htm

ed.

"Hal Rosser" <hm******@bellsouth.net> wrote in message
news:lJ******************@bignews6.bellsouth.net.. .
你不必做所有那些混乱
使用DateAdd,DateDiff等
- 但如果你是从文本框工作并试图模拟vb可以做什么 - <你可以使用整数除法运算符\和Mod操作员将除以60并获得剩余部分

Dennis D. < TE ** @ dennisys.com>在消息中写道
新闻:%2 *************** @ TK2MSFTNGP10.phx.gbl ...
you don''t have to do all that mess
use DateAdd , DateDiff, etc
--but if you''re working from text boxes and trying to simulate what vb can
do -
you can use the integer division operator "\" and the "Mod" operator to
divide by 60 and get the remainder

"Dennis D." <te**@dennisys.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
试图写一个行程计划。

从日期时间选择器获取日期和时间
将其转换为日期变量以提取日期和时间
表单首先有一个文本框,显示开始日期和时间通过
选择器。
接下来的几个文本框允许用户输入发生事件
已用时间的小时和分钟
每个文本框从前一个框中减去或添加以显示新的
日期时间

例如:
开始日期是9/9/2004 2:15:00 AM
我想减去4小时30分钟(a从开始日期开始更改用户输入到
文本框并生成新的日期时间(
Trying to write an itinerary program.

Got date and time from date time picker
Converted it to date variables to extract the date and the time
The form has first a textbox displaying the starting date and time via the picker.
The next few text boxes allow user input of hours and minutes for elapsed time of occurring events
Each text box subtracts or adds from the previous box to reveal a new date time

Example:
The start date is 9/9/2004 2:15:00 AM
I want to subtract 4 hours and 30 minutes (a changeable user input to a
textbox) from the start date and produce a new date time (which is


转换为字符串并输出到显示) 。

问题:我怎样才能从上班时间借阅会议记录,以及从第几天开始借阅的时间at是必需的。

另外,对于输出显示,是否通常使用文本框或标签
控制输出结果?
to a string and output to a display).

The problem: How can I get the minutes to borrow from the hours, and the
hours to borrow from the date when that is required.

Also, for the output display, is it typical to use a textbox or a label
control for output results?



---
发送邮件经过无病毒认证。
由AVG反病毒系统检查( http://www.grisoft.com)
版本:6.0.732 /病毒库:486 - 发布日期:2004年7月29日


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 7/29/2004





" Dennis D." < TE ** @ dennisys.com>在消息中写道

news:e1 **************** @ TK2MSFTNGP11.phx.gbl ...

"Dennis D." <te**@dennisys.com> wrote in message
news:e1****************@TK2MSFTNGP11.phx.gbl...
获取用户输入的文本框默认为系统日期,除非我从日期时间选择器克隆日期并添加或减去
小时和分钟。

我我还有一个问题:如何让vb从
父变量值中借用?

所有混乱都是表格。
<谢谢。可以使用更多的输入。
The textbox that gets the user input defaults to the system date unless I
clone the date from the date time picker and either add or subtract the
hours and minutes.

I''m still left with the question: How do I get vb to borrow from the
parent
variable values?

All that mess is the form.

Thanks. Could use more input.




这并不像你想象的那么难。你可以发布你尝试过的代码吗?



This is not as hard as you seem to be making it. Can you post the code that
you have tried?


这篇关于DateTime地狱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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