473,776 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5314
"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*******@free net.de> wrote in message
news:uD******** ******@tk2msftn gp13.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.344780092 6
d = dbSerial
How can I do this in .NET
Mar 16 '06 #3
"Peter" <pc*****@nospam .nospam> schrieb

"Armin Zingler" <az*******@free net.de> wrote in message
news:uD******** ******@tk2msftn gp13.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.344780092 6
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.FromOA Date(38793.3447 800926)

Where do you get the value 38793.344780092 6 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
43073
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 (or would HDD be better, or both?) and put that info into VB prog so the program won't work on another computer. My program uses an MSAccess table. Much appreciated if you can help! Thanks
0
2193
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 some of my projects and I'm done with it. hope anyone would benefit from it #------------------------------------------------------------------------------------------------
3
17010
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=> alter table tickets add column rid serial; NOTICE: ALTER TABLE will create implicit sequence "tickets_rid_seq" for SERIAL column "tickets.rid" ERROR: adding columns with defaults is not implemented
6
6983
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
14025
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 students)
4
15413
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 converts Dates into serial numbers, but I can't figure out how to do it with VB.Net. Please help, thanks.
3
1628
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 machine. For example: if the Equipment Table had Serial Numbers: 123 and 456 in it. And the Software Table had Widget Version 4, Fishing Version 2, and Vacation Version 10 in it.. How would I show in a Form:
3
2719
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
1648
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 shortly which will be used by a few users (less than say 200) but I need a way to protect it and force the user to renew his subscription once his license expires a year after purchasing it. What I had in mind was generating a serial key for each...
0
9628
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9464
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
10120
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...
1
10061
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5367
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
5493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2860
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.