I am building a chat program and I would like to have the time. That the message was sent to appear with the message. Or have the current time appear in the top of the chat window. Any help would be great.
a little example of code, you'll understand it right away (very easy)
dim strTimeRightNow as string 'bleh not important for this one
strTimeRightNow = time 'the variable will contain the time for that moment, it's the same with date and who knows what other ones there are :)
when i want a clock i found it works well to put a timer on the page and set the interval at one second, then make the code for the interval as follows:
that makes the text1 display the current time every time the timer counts up one which is every second. thus you get a clock. also if you use DateTime.Date you can display the date. and these can also be used to change the computers date and time settings.
That's actually the same thing. I didn't know about the DateTime object before, but it turns out that specifying 'DateTime' isn't necessary.
Text1.Text = DateTime.Time
is just like saying
Text1.Text = Time
However, typing DateTime out is useful in that it shows you all the different methods and properties it supports.
humm, i didn't know that, saves me some typing next time. thanks
also, i shouldn't say this without trying it first to make sure i got it right, but i think you can do format(date, "dd mm yy") or something like that, and there is probably one like that for time as well. ask neo, i think he knows it...
yeah, that one is well used by me. Look up the Format Function. It can do all kinds of things.
Format(Time, "hh:mm:ss AM/PM")
Format(Date, "mm-dd-yyyy")
Format(12.4212, "Currency")