I am working with a very old database system (building an import/export routine) that stores the time in seconds. I have been
able to convert the seconds to correct time (thanks to a lot of help in this group).
But, I need to be able to write back the time of day to the db in seconds.
Example:
01:00:00 PM should be 46800 seconds.
I can get it to work in an odd sort of way like this:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim dt As Integer
dt = New Date().Subtract(TextBox2.Text).TotalSeconds.ToStri ng
TextBox1.Text = dt.ToString
End Sub
But, if you run this and have the above time in Textbox2 ( 01:00:00 PM) it will show -46800 seconds in Textbox1.
I have tried several variations of the Date function, but, it appears that only the .Subtract function has the .TotalSeconds
function.
And as noted, it gives a negitive number instead of a postive number.
Any suggestions ? ( besides running as far away from the DOS based Dataflex database as I can :-)
james