|
-
Oct 22nd, 2003, 10:53 AM
#1
Thread Starter
Addicted Member
convert date to a number with vb.net
how can i convert date to a number with vb.net
example in vb6:
Private Sub Form_Load()
Text1.Text = Date
End Sub
Private Sub Command1_Click()
Dim num
num = Format(Text1.Text, "0")
Text2.Text = num
End Sub
thanking you in advance
From:
[email protected]
-
Oct 22nd, 2003, 11:55 AM
#2
what is the output of that? I dont have VB6, it would be helpful if you give an example of the current date + the output on textbox2
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Oct 22nd, 2003, 12:12 PM
#3
Thread Starter
Addicted Member
example of number:
22/10/2003 = 37916
-
Oct 22nd, 2003, 12:28 PM
#4
PowerPoster
How are those numbers related?
-
Oct 22nd, 2003, 12:51 PM
#5
Thread Starter
Addicted Member
every number represent a date
to convert the date of Today to a number:
TextBox1.Text = Date.Today.ToOADate
to convert the number to date:
Dim num As Double
num = Val(Trim(TextBox1.Text))
TextBox2.Text = Format(Date.FromOADate(num),"dd/MM/yy")
-
Oct 23rd, 2003, 09:04 AM
#6
Junior Member
Convert a date entered into TextBox1, into a number ...
TextBox2.Text = Date.Parse(TextBox1.Text).ToOADate
-
Oct 23rd, 2003, 11:42 AM
#7
Thread Starter
Addicted Member
Convert a date entered into TextBox1, into a number
To skid2964
excellent answer
thank you very much
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
|