473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Visual Basic code to convert Current time (12hr) to 24 hour

stephie3883
I need to create a code that converts the current 12hr time to 24hr time (excluding seconds). so far i have:

Expand|Select|Wrap|Line Numbers
  1. Sub x24hr_time
  2. Dim currenttime As String
  3. currenttime=TimeOfDay.ToString("hh:mm")
But how do you enter in the current time to Visual basic?
Feb 28 '13 #1
3 2638
Rabbit
12,516 Expert Mod 8TB
What you have there looks like VB.Net code instead of VB6, let me know what language you're using and I can move it to the right forum if you're in the wrong one.
Feb 28 '13 #2
The program is suppose to be in VB6, i think i got my commands confused
Feb 28 '13 #3
Rabbit
12,516 Expert Mod 8TB
I believe in VB6, the Now function returns the current date and time. You can combine that with the Format function to display it in whichever format you define.
Feb 28 '13 #4

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

Similar topics

8
by: Chris | last post by:
Sorry, This should be simple, but brain is hurting... How do I convert a Current Time to a Decimal 6,0 (HMS)? There must be a cleaner way then this: Insert into Table Values Dec(...
0
by: CrAn57 | last post by:
I'm using Visual Studio .net, and am programming a web form in Visual Basic (including the HTML page, and the VB code behind page). I have a flash .swf on the HTML side of the page, but want to...
4
by: perryschon | last post by:
Can someone please help me out with the Visual Basic source code needed that allows configuration and usage of comm ports in any PC? I am constructing an asynchronous serial communication RS-232...
2
by: sbweld | last post by:
Hello, I am using Powerpoint 2007 and have found an option to integrate visual basic code into the slides. I am building a standalone Kiosk and I want my powerpoint presentation to reset and go...
1
by: Pradeepgupta | last post by:
Hello! i my searching maximum of the sites for Shot out my small problem by getting the code for Blocking the current running URL & Knowing the same through Visual basic 6.0 my fava....
1
by: AMK2701 | last post by:
Hi, I am just new at using this code, so have probably made a really simple mistake. My code works fine just in the sub form I created it, but when putting the sub form in the main form, the code...
4
by: raaman rai | last post by:
guys, what is the idea to backup sql server databse via visual basic code. And i also want the code please.
0
by: Serenityquinn15 | last post by:
Hi! I have two Table names: tblupdate tblDetails What i want to do is to update the table tblupdate from tblDetails using the button in Visual basic Interface.
2
by: paliko | last post by:
a Visual basic code for an online tax payment system
1
by: vinayreddy | last post by:
How to see visual basic code of ms access file inorder to change the path of the database resides. Please any body can provide solution for this.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.