?
Solved

How to convert MS Access time format to 24 hour format

Posted on 2009-04-10
3
Medium Priority
?
1,281 Views
Last Modified: 2012-08-14
Hi Experts ,

I have a database field with the time in the following format

10/04/2009 2:50:00 PM

I need to convert that to 14:50:00

Could someone please show me how to

Thanks
0
Comment
Question by:meperera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 2000 total points
ID: 24114060
Date/time in a field is not of a specific format.
But you can choose to have it displayed in a specific format.
The format string you request is:

hh:nn:ss

Can be inserted in the format property of a field or used with the function Format:

strTime = Format([YourDateTimeField], "hh:nn:ss")

/gustav
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24114151
if your app is international or maybe you use different delimiters for time, you can use "short time" as the 2nd argument in the format command. THis takes the international settings as defined in control panel.
0
 
LVL 12

Expert Comment

by:Dimitris
ID: 24115452
try this
Format("10/04/2009 2:50:00 PM", "dd/MM/yyyy hh:mm:ss")
it will convert it to
---------------------------
10/04/2009 14:50:00
---------------------------
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question