Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
24 Hour or Military Time
Daniel Schuster 
     
4 years ago
I need to display times in 24-hour time: 1:30 pm == 1330
How do I do that? I saw a video about making a query change the displayed time to something different using crazy equations, so I assume it's something like that. Thanks in advance for any suggestions.
-Daniel
Kevin Robertson  @Reply  
          
4 years ago
You can use format codes in the format property - hh:nn

or in a query use the format function - X: Format(myTime, "hh:nn")
Scott Axton  @Reply  
        
4 years ago
Just to add to Kevin's post - 24 hr time is the default.  Unless you specify the AM/PM as in hh:nn AM/PM
If you don't want the colon leave it out.  Remember that minutes is 'n' (month is 'm')

Time formats were covered extensively in the Beginner 3 course.
Also check out the 12 Hour Time with NO am/pm and the Date Only TechHelp videos.  Those have good info as well.
Daniel Schuster OP  @Reply  
     
4 years ago
Thank you for your responses. is there any way to allow my users to input military time? Right now, when I type '1730' it gives me an error (because that's not an actual time in access). Can I somehow make Access translate '1730' to 5:30p then redisplay it at 1730?

I didn't ask my first question clearly and I apologize. Thank you again for your help!
Scott Axton  @Reply  
        
4 years ago
I did some playing - still looking at it.
If you type 17:30 works fine.  If you type 1730 it fails.

The formatting (display) and the way Access stores the data are two different things.

If you want the date + time you would type 5/22 17:30
Assuming the format of the field is hhnn the date would go away and just display the time as 1730 until you click on the field again then it displays as the whole date and time.
Access uses the regional settings of the computer to control a bunch of how things are handled by default.

Unfortunately I think you are going to have to type the colon.  You might be able to set an input mask to insert the colon for you so you only have to type numbers,  Thought I haven't given that a shot yet
Kevin Yip  @Reply  
     
4 years ago
Richard also made a video on two-digit hour appearing as one-digit in some instances, and how to get around it: https://www.599cd.com/tips/access/140427-two-digit-hour-format-hh/default.asp

To type and display military date and time:
- Use the input mask:  00/00/00#00:00
- Use the format property:  dd mmm yy hhnn

When the user types:   052722 space 0140
It will show:  27 May 22 140

It's supposed to show 0140, but shows only one-digit hour, as mentioned Richard's video.

The user still needs to type a space between the date and time, and needs to type month before date if the PC is configured that way in the regional settings.

And you can't type only the time.  A date/time field in Access always contains both date and time.  If you omit the date, Access will enter 1/1/1980.  If you omit the time, it will enter 12am.
Richard Rost  @Reply  
          
4 years ago
Yeah, you'd have to set up a custom field as Short Text to allow the user to type in just 0130 and then you'd have to parse it out in VBA and save that to a Date field. It's a lot of work to just get around not having to type in a colon. But... if you really need it let me know and I'll add it to my Fast Tips video list.
Daniel Schuster OP  @Reply  
     
4 years ago
Thank you all for your attention to this matter. I will have to talk to the office that I'm building this for and see if I can convince them that typing a colon isn't so bad. The input mask thing sounds like the way to go. Let me know if you figure it out.
Kevin Robertson  @Reply  
          
4 years ago
For the input mask use: 00:00
Kevin Robertson  @Reply  
          
4 years ago

Richard Rost  @Reply  
          
4 years ago
Kevin has the best solution.

Format: hh:nn
Input Mask: 00:00


You need that : in the input mask so Access knows you're entering a time. If you want it to only DISPLAY 1430 then you can change the format to hhnn. But you have to have that colon in the input mask even though it won't show.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/1/2026 5:46:06 PM. PLT: 1s