#2:00:00 AM# 
Author Message
 #2:00:00 AM#

Hello all, Does anyone know what format is this?...

I am adding two hours two hours to the current time by doing this...

temp = Now + #2:00:00 AM#

now it works fine...but I want the user to be able to enter how many
hours to enter....So I enabled them to enter it in a textbox...But
when I do this:

temp = Now + Textbox1.Text

it doesn't work..it gives me a mismatch error....Does anyone know the
format of this time?...and how to make this code work?

thank you in advance

Jazz



Sat, 07 Feb 2004 04:17:05 GMT  
 #2:00:00 AM#
Unless there's a specific reason to use your current method, you may want to
look at the DateAdd function in MSDN

temp = DateAdd("h",val(Textbox1.Text),Now)


Quote:
> Hello all, Does anyone know what format is this?...

> I am adding two hours two hours to the current time by doing this...

> temp = Now + #2:00:00 AM#

> now it works fine...but I want the user to be able to enter how many
> hours to enter....So I enabled them to enter it in a textbox...But
> when I do this:

> temp = Now + Textbox1.Text

> it doesn't work..it gives me a mismatch error....Does anyone know the
> format of this time?...and how to make this code work?

> thank you in advance

> Jazz



Sat, 07 Feb 2004 04:35:54 GMT  
 #2:00:00 AM#
Hugh's advice is best, but I think the problem you're having is that the
textbox text is seen as character data and VB can't figure out how to
convert it. Try Now + CDate(Textbox1.Text).

Really, try DateAdd


Quote:
> Hello all, Does anyone know what format is this?...

> I am adding two hours two hours to the current time by doing this...

> temp = Now + #2:00:00 AM#

> now it works fine...but I want the user to be able to enter how many
> hours to enter....So I enabled them to enter it in a textbox...But
> when I do this:

> temp = Now + Textbox1.Text

> it doesn't work..it gives me a mismatch error....Does anyone know the
> format of this time?...and how to make this code work?

> thank you in advance

> Jazz



Sat, 07 Feb 2004 20:30:42 GMT  
 #2:00:00 AM#
Hmm,

Well what is in a Date variable ? - IME a double precision number, on
the left of the dp is a Julian/Gregorian and on the right 24ths of an
hour.

Date2 = Now + 2/24    should do what you want.

This all brings up the problem of where a language should start - and
more pertinently - where it should end.  Should MS really be providing
'library' routines as part of the language ?

Especially iffy Locale aware stuff that will blow under the least
pressure.

IMO, no - but they must know better - after all they are the experts.

On Tue, 21 Aug 2001 08:30:42 -0400, "Steve Gomori"

Quote:

>Hugh's advice is best, but I think the problem you're having is that the
>textbox text is seen as character data and VB can't figure out how to
>convert it. Try Now + CDate(Textbox1.Text).

>Really, try DateAdd



>> Hello all, Does anyone know what format is this?...

>> I am adding two hours two hours to the current time by doing this...

>> temp = Now + #2:00:00 AM#

>> now it works fine...but I want the user to be able to enter how many
>> hours to enter....So I enabled them to enter it in a textbox...But
>> when I do this:

>> temp = Now + Textbox1.Text

>> it doesn't work..it gives me a mismatch error....Does anyone know the
>> format of this time?...and how to make this code work?

>> thank you in advance

>> Jazz



Sat, 07 Feb 2004 22:09:18 GMT  
 #2:00:00 AM#

Quote:

> Hmm,

> Well what is in a Date variable ? - IME a double precision number, on
> the left of the dp is a Julian/Gregorian and on the right 24ths of an
> hour.

> Date2 = Now + 2/24    should do what you want.

At least until Date is changed to be seconds past midnight 1970-01-01 GMT,
as God had intended, anyway...

Quote:
> This all brings up the problem of where a language should start - and
> more pertinently - where it should end.  Should MS really be providing
> 'library' routines as part of the language ?

> Especially iffy Locale aware stuff that will blow under the least
> pressure.

DateAdd is locale aware?

Quote:
> IMO, no - but they must know better - after all they are the experts.

Hah!  You do realize, don't you, that you're talking about the utter
morons who trashed VBA.VbCompareMethod.vbDatabaseCompare?

http://groups.google.com/groups?selm=%23ttNGRAy%23GA.307%40cppssbbsa04

http://support.microsoft.com/support/kb/articles/Q198/5/03.ASP

http://support.microsoft.com/support/kb/articles/Q151/1/64.ASP

--
Joe Foster <mailto:jlfoster%40znet.com>  Sign the Check! <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Sun, 08 Feb 2004 23:03:02 GMT  
 #2:00:00 AM#
On Wed, 22 Aug 2001 08:03:02 -0700, "Joe \"Nuke Me Xemu\" Foster"

Quote:


>> Hmm,

>> Well what is in a Date variable ? - IME a double precision number, on
>> the left of the dp is a Julian/Gregorian and on the right 24ths of an
>> hour.

>> Date2 = Now + 2/24    should do what you want.

>At least until Date is changed to be seconds past midnight 1970-01-01 GMT,
>as God had intended, anyway...

This all gets a bit confusing - the underlying date is based on
100-nanosecond intervals since January 1, 1601

VB has its own date structure - I guess the 1970 basis is the C
seconds elapsed.

Quote:

>> This all brings up the problem of where a language should start - and
>> more pertinently - where it should end.  Should MS really be providing
>> 'library' routines as part of the language ?

>> Especially iffy Locale aware stuff that will blow under the least
>> pressure.

>DateAdd is locale aware?

If the date is a literal - then yes it has to be
Quote:

>> IMO, no - but they must know better - after all they are the experts.

>Hah!  You do realize, don't you, that you're talking about the utter
>morons who trashed VBA.VbCompareMethod.vbDatabaseCompare?

>http://groups.google.com/groups?selm=%23ttNGRAy%23GA.307%40cppssbbsa04

Bulgarian Strings (!?!)
Quote:

>http://support.microsoft.com/support/kb/articles/Q198/5/03.ASP

Yerk ... To clever by half string compares - heck the Germans were
smart enough to use a trailing 'e' instead of an umlaut.

Quote:

>http://support.microsoft.com/support/kb/articles/Q151/1/64.ASP

I did not know about those - personally I have always used my own
Julian/Gregorian methods - and only really trusted Date$

Oddly in some ways, being UK based is an advantage, as you are forced
to 'work around' problems before others get to them.

Quote:

>--
>Joe Foster <mailto:jlfoster%40znet.com>  Sign the Check! <http://www.xenu.net/>
>WARNING: I cannot be held responsible for the above        They're   coming  to
>because  my cats have  apparently  learned to type.        take me away, ha ha!



Mon, 09 Feb 2004 00:26:27 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. #2:00:00 AM# Format

2. MAC Address = 00 00 00 00 00 ????

3. Returned MAC-Adress is only 00 00 00 00 00 ????

4. Date of 00/00/96

5. find convert input/ouput file QB2.00->VB3.00

6. Need comdlg32.dep ver 6.00.8169 and comctl32.dep ver 6.00.8022

7. Upgrading from comctl32 5.00.3714 to 5.00.3828

8. Problems after Upgrade 4.00.3711.08 to 4.00.5303.01

9. Windows CE .NET Online Chat - July 26th 12:00-13:00 PST (20:00 BST, 19:00 GMT)

10. ADO/SQL Server: datetime column appears to be "1901-1-1 00:00:00" after insertion

11. ANN: Windows CE .NET Online Chat - July 24th 12:00-13:00 PST (20:00 BST, 19:00 GMT)

12. Access '00 Primary Key Qstn

 

 
Powered by phpBB® Forum Software