Solved

How to convert MS Access time format to 24 hour format

Posted on 2009-04-10
3
1,271 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
3 Comments
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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.

809 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