|
-
Jan 15th, 2004, 03:03 PM
#1
Thread Starter
Hyperactive Member
Convert Date to Integer...
Howdy folks,
How do I convert a date into an integer a la VB 6?
Thanks,
Ben
-
Jan 15th, 2004, 06:03 PM
#2
Frenzied Member
Not sure about VB6, but what do you want the integer to represent?
Ticks will give you a Long - "The value of this property is the number of 100-nanosecond intervals that have elapsed since 12:00 A.M., January 1, 0001" - MSDN
I've seen some databases that store dates (not date/time) as the number of days since some start date - these are usually integers - but not sure if that's what you're after.
-
Jan 16th, 2004, 08:59 AM
#3
Thread Starter
Hyperactive Member
I'll be honest, I don't actually know what I'm talking about. 
I've got a control that was developed for VB 6 that I'm using in my VB.NET application. Here is a help excerpt from a function I want to use:
Code:
Parameters
· 1 - nIndex : ( integer ) The index value of the item to receive the bar
· 2 - lTimeStart : ( long ) The starting time for the bar
· 3 - lTimeEnd : ( long ) The ending time for the bar
· 4 - lDateStart : ( long ) The starting date for the bar
· 5 - lDateEnd : ( long ) The ending date for the bar
Example
nBar = ctSchedule.AddTimeBar(nIndex, 240, 600, 35550, 35550)
Does anyone know how I would translate a date into that '35550' number?
Thanks,
Ben
-
Jan 16th, 2004, 03:46 PM
#4
Frenzied Member
Do you know the date that 35550 represents? I'm guessing that if they're using seperate time and date fields, 35550 is the number of days since a certain start date - but you need to know what the start date is, or you can figure it out if you know the date of 35550.
-
Jan 16th, 2004, 04:19 PM
#5
Thread Starter
Hyperactive Member
Good call,
I can reverse out a date from the control and determine what that number is.
Thanks for your help,
Ben
-
Jan 17th, 2004, 12:41 AM
#6
Addicted Member
Convert date to number and number to date
Hi,
Convert date to number and number to date
Watch and copy examples of Source Code in VB.NET
http://www.run.to/yulyos-vbnetat
Have a nice day
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|