By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,095 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,095 IT Pros & Developers. It's quick & easy.

Print Current Time and Date

P: 28
Hi!

I would like some help. I want to print the current date and time in a form . Can anyone help?
I am using VB2005

thnks
Apr 3 '07 #1
Share this Question
Share on Google+
7 Replies


vijaydiwakar
100+
P: 579
Hi!

I would like some help. I want to print the current date and time in a form . Can anyone help?
I am using VB2005

thnks
use format along with datetime function
Apr 3 '07 #2

P: 28
use format along with datetime function
can you write some code because i am a beginner in VB?
thanks
Apr 3 '07 #3

vijaydiwakar
100+
P: 579
can you write some code because i am a beginner in VB?
thanks
try this code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         Me.Text = Date.Today.Date
  3.     End Sub
  4.  
Apr 3 '07 #4

P: 28
try this code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         Me.Text = Date.Today.Date
  3.     End Sub
  4.  
this is fine thanks.
if want to print the time also?
Apr 3 '07 #5

vijaydiwakar
100+
P: 579
this is fine thanks.
if want to print the time also?
Me.Text = DateTime.Now
Apr 3 '07 #6

100+
P: 149
this is fine thanks.
if want to print the time also?

DateTime.Now

thanks
ansuman
Apr 3 '07 #7

P: 28
thanks a lot.case close
Apr 3 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.