473,395 Members | 1,680 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,395 software developers and data experts.

Serial Date

What is the easiest way to convert serialdate (like excel has) into real
date in VB.NET?
Thank You
Peter
Mar 16 '06 #1
4 5289
"Peter" <pc*****@nospam.nospam> schrieb
What is the easiest way to convert serialdate (like excel has) into
real date in VB.NET?


What is a serial date? Is it a Double, an Integer or what? Does it have a
base date like 1/1/1900? Have a look at the constructors and other members
of the DateTime data type.
Armin

Mar 16 '06 #2

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uD**************@tk2msftngp13.phx.gbl...
"Peter" <pc*****@nospam.nospam> schrieb
What is the easiest way to convert serialdate (like excel has) into
real date in VB.NET?


What is a serial date? Is it a Double, an Integer or what? Does it have a
base date like 1/1/1900? Have a look at the constructors and other members
of the DateTime data type.
Armin


In VB6 you could do the following

Dim d As Date
Dim dbSerial As Double

d = Now
dbSerial = d +1
'
' or
'
db = 38793.3447800926
d = dbSerial
How can I do this in .NET
Mar 16 '06 #3
"Peter" <pc*****@nospam.nospam> schrieb

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uD**************@tk2msftngp13.phx.gbl...
"Peter" <pc*****@nospam.nospam> schrieb
What is the easiest way to convert serialdate (like excel has)
into real date in VB.NET?


What is a serial date? Is it a Double, an Integer or what? Does it
have a base date like 1/1/1900? Have a look at the constructors
and other members of the DateTime data type.
Armin


In VB6 you could do the following

Dim d As Date
Dim dbSerial As Double

d = Now
dbSerial = d +1
'
' or
'
db = 38793.3447800926
d = dbSerial
How can I do this in .NET

Have a look at the members of the DateTime data type. For example:

dim d, nextday as date

d = now 'or datetime.now
nextday = d.AddDays(1)

d = DateTime.FromOADate(38793.3447800926)

Where do you get the value 38793.3447800926 from?
Armin

Mar 16 '06 #4
Hi,

AFAIK, An Excel Serial Date is the number of days since 1-1-1900.

For eg., Excel stores March 17, 2006, as serial number 38793 because it
is 38,793 days after January 1, 1900. The digits after the period in
Peter's example are probably the no. of seconds elapsed in that day.

Excel stores dates as sequential serial numbers so that it can perform
calculations on them. Excel stores January 1, 1900, as serial number 1.
But if the members of the DateTime class have any pre-built conversion
defined, of that I'm not too sure. Maybe Armin (Who, I have noticed, is
our DateTime authority... ;-)) can help here.

Regards,

Cerebrus.

Mar 17 '06 #5

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

Similar topics

21
by: Gavin | last post by:
Hi, I'm a newbie to programming of any kind. I have posted this to other groups in a hope to get a response from anyone. Can any one tell me how to make my VB program read the Bios serial number...
0
by: Polerio Babao Jr.II | last post by:
file fbus3.py resource shared by Chris Liechti <cliechti@gmx.net> during the conversation last september 2002. I made it available so that other user would benefit from it. I've used with...
3
by: Claudio Lapidus | last post by:
Hello Now perhaps this is a bit dumb, but... I just populated a new table via \copy. After that, I realize that perhaps is a good thing to have a row identifier in it, so I try clapidus=>...
6
by: Peter Krikelis | last post by:
Hi All, I am having a problem setting up input mode for serial communications. (Sorry about the long code post). The following code is what I use to set up my comm port.
6
by: Jeff | last post by:
Hello, Someone can help me about serial port with C++ .NET (Windows forms application). Like setting port, opening it, transmiting, receiving, closing, etc. Thanks very much (for me and my...
4
by: Daniel Kaseman | last post by:
How do I convert a date into a serial number? (I'm trying to enter a FROM date and a TO date, then make my PROGRESS BAR show how close I am to the TO date.) get it? I know that MS Excel...
3
by: george.e.sullivan | last post by:
Hello all, I have three tables Employess, Equipment, and Software. I have tried without success to figure out how to show a single Equipment Serial Number show all the software installed on that...
3
by: Glencannon4424 via AccessMonster.com | last post by:
Hello, I have what I believe amounts to a Date Serial issue. I have the following columns in my table: Hire-Date Hire-Year WTD-RATE Wks-in-Yr
3
by: StefanPienaar | last post by:
Hi Everyone Ok I really can say that I did first try and get an answer for this by googling a whole day long and I still couldn’t find what I’m looking for. I will be releasing an application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.