473,832 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2748
"Bob Day" <Bo****@TouchTa lk.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****@TouchTa lk.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/
vagrptypeconver sion.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
1264
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 try to build the date from the components (i.e d.getMonth() etc...) the result is an incorrect date. How can the date be both correct and incorrect at the same time? The intial alert(d); displays correctly, but the alert(t + "/" + m + "/" + y);...
38
7174
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; } function makeArray0() {
3
3715
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 then how to Validate the Text field for above. thanks RSB
4
6143
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
43894
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 to DATE or TIME? The column data is in the date form YYYYMMDD (i.e. 20060308 = March 8 2006). I want to get the data into a DATE type. I tried TO_DATE('20060308','YYYYMMDD') but I cannot get it to work. What else can I do to conver the data...
13
16180
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 local time from UTC function formatToLocalTimeDate(inDate) { var today = new Date(); var inDateMod = new Date(inDate);
3
1583
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 SQL Server 2005 aspnet_Membership table such as LastLockoutDate and FailedPassword with dates for all users entered as 1/1/1754. Not only is this goofy bullsh!t it is grossly incorrect goofy bullsh!t. I have used one of my three test users to...
44
10249
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
3255
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 be updated to the curent date, year, month, date name I wrote something like.
3
2102
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:") str.Append(Environment.NewLine) str.Append(dx.Date.ToString)
0
9795
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10780
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10498
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5623
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3077
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.