|
-
Mar 8th, 2010, 03:55 PM
#1
Thread Starter
Addicted Member
Time
Code:
Dim time As String
time = Now.ToString("HH:mm")
This is code I have been using already.
I have format, for example
08:00
And how to get format
8:00
Thanks!
-
Mar 8th, 2010, 03:57 PM
#2
Re: Time
Use "h:mm" instead of "HH:mm".
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Mar 8th, 2010, 04:03 PM
#3
Thread Starter
Addicted Member
Re: Time
Yes, that's it, i tried with H:mm, and it didn't work, and h:mm work. Thanks!
And how to check is in some textbox current date every second, and if it is display in messagebox ("yes")
?
Last edited by hepeci; Mar 8th, 2010 at 04:11 PM.
-
Mar 8th, 2010, 04:33 PM
#4
Re: Time
You need to read the documentation. It's all there in MSDN library:
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
"how to check is in some textbox current date every second": that's what timers are for. You need a timer, set its interval to 1000ms (1 second) and in the timer.tick event handler, you read the current date (Date.Now) and get the date part of it, compare that to your date.
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Mar 8th, 2010, 04:38 PM
#5
Re: Time
 Originally Posted by hepeci
Code:
Dim time As String
time = Now.ToString("HH:mm")
This is code I have been using already.
I have format, for example
08:00
And how to get format
8:00
Thanks!
HH signifies 24 hour clock time. So to keep that format
Code:
Dim TimeStr As String = Date.Now.ToString("HH:mm").TrimStart("0"c)
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
|