Solved

How to convert MS Access time format to 24 hour format

Posted on 2009-04-10
3
1,272 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 50

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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.

762 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