Howdy folks,
How do I convert a date into an integer a la VB 6?
Thanks,
Ben
Printable View
Howdy folks,
How do I convert a date into an integer a la VB 6?
Thanks,
Ben
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.
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:
Does anyone know how I would translate a date into that '35550' number?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)
Thanks,
Ben
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.
Good call,
I can reverse out a date from the control and determine what that number is.
Thanks for your help,
Ben
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