473,323 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Date time incorrect

Using VS 2003, VB.NET, MSDE...
This is incredible misleading that the following produces a results of
#2/13/04# if you hover your mouse over the Date_Time_Begin, although I do
think its value is #2/13/04 12:00:00AM#. This should be correct.

' convert into date.

Dim Date_Time_Begin As DateTime = CDate("#2/13/04 12:00:00 AM#")

Please advise

Bob Day
Nov 20 '05 #1
4 2725
"Bob Day" <Bo****@TouchTalk.net> schrieb
Using VS 2003, VB.NET, MSDE...
This is incredible misleading that the following produces a results
of #2/13/04# if you hover your mouse over the Date_Time_Begin,
although I do think its value is #2/13/04 12:00:00AM#. This should
be correct.

' convert into date.

Dim Date_Time_Begin As DateTime = CDate("#2/13/04 12:00:00 AM#")

#2/13/04# and 2/13/04 12:00:00AM# are equal, so I don't see the point.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* "Bob Day" <Bo****@TouchTalk.net> scripsit:
Using VS 2003, VB.NET, MSDE...
This is incredible misleading that the following produces a results of
#2/13/04# if you hover your mouse over the Date_Time_Begin, although I do
think its value is #2/13/04 12:00:00AM#. This should be correct.


I am not sure what's the problem. Are you referring to the missing time
part?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Hi Bob,

From your description, it seems that you are in debug mode, so that when
you hover your mouse over the Date_Time_Begin, you will see the #2/13/04#

MSDN said the January 1, 0001 or 00:00:00 will be a neutral value. So the
result string did not include the January 1, 0001 or 00:00:00 .

12:00:00 AM means 00:00:00 in .net.

The Date data type always contains both date and time information. For
purposes of type conversion, Visual Basic .NET considers 1/1/1 (January 1
of the year 1) to be a neutral value for the date, and 00:00:00 (midnight)
to be a neutral value for the time. If you convert a Date value to a
string, CStr does not include neutral values in the resulting string. For
example, if you convert #January 1, 0001 9:30:00# to a string, the result
is "9:30:00 AM"; the date information is suppressed. However, the date
information is still present in the original Date value and can be
recovered with functions such as DatePart.

Type Conversion Functions
http://msdn.microsoft.com/library/de...us/vblr7/html/
vagrptypeconversion.asp

You may try to change the #2/13/04 12:00:00AM# to #2/13/04 12:01:00AM# to
see if you can see complete format.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #4
Hi Bob,

Thanks for posting in the community.

Did you still have any concern on this issue about DateTime format?
If so, please post here and I will work on with you.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David Thomas | last post by:
Hi, I've written a simple script to test the current date and perform an action depending on the result. The problem is, the date displays correctly as a complete date in an alert box but when I...
38
by: | last post by:
I have a script... ----- <SCRIPT language="JavaScript" type="text/javascript"> <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this = makeArray.arguments; } ...
3
by: RSB | last post by:
Hi Every one , IS there any Date Time Control with .Net. All i want to read is the Date and Time in a Single Field like 12/31/2004 09:23:23AM. if there is any then any examples for it. and if not...
4
by: JIM.H. | last post by:
Hello, I put a compare validator in to my applications and set the type as Date. It works for “MM/dd/yyyy” but not for “MM/dd/yyyy hh:mm:ss”. How can I validate time part too? Thanks,
5
by: Ray | last post by:
I have a table with some audit date and time columns. Problem is the developer who stored the data left them as DECIMAL type instead of DATE and TIME. Is there a way I can convert the DECIMAL type...
13
by: maflatoun | last post by:
Hi, I have the following function to convert UTC time to Local time. It works perfect for GMT- (Minus) time zones however it provides incorrect results for GMT+(Plus) time zones? // Format to...
3
by: clintonG | last post by:
What's with this software? Every day its a new surprise with some goofy bullsh!t. I finally make time to try to finish building out Membership logging and reporting and today its user data in the...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
1
by: sibusiso | last post by:
HI Can Any one help I have extra field on a table like FDate, FYear, FMonth, FDay, FDatename I have a triger that I will update this field every time transaction hapened, this field must...
3
Frinavale
by: Frinavale | last post by:
Want to see something weird? The following code: Dim str As New StringBuilder Dim x As String = "11/6/2009 14:00" Dim dx As Date Date.TryParse(x, dx) str.Append("dx:")...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.