473,416 Members | 1,871 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,416 software developers and data experts.

Convert military time to 12 hour time

I have data in this format 0800, 1730, 0930, etc.
I do not know how to convert this time to read something like, 8:00AM, 5:30 PM, 9:30AM etc.
Also I want to group things by day. I have courses taken on different days of the week at different time. E.g. Math02 on Wednesday at 8:30 AM to 11:30AM.
So I want to show Time of Day, (eg 6:30 AM - 9:00 AM) Day (eg Monday) ad group the courses taken by day and time.
Please assist
Thanks
O
Aug 31 '07 #1
1 19885
missinglinq
3,532 Expert 2GB
Time is actually stored in Access as, well, time! How it'd displayed depends on how it's formatted.
Short Time (also known as Military time) would be 14:12
Medium Time would be 02:12 PM
Somewhere, either in the table definitions or in the form itself, your times are formatted as Short time. You can change this by changing the format to Medium Time in the table definitions, in the control's property box in the form, or in VBA code
Expand|Select|Wrap|Line Numbers
  1.   Format(YourTime, "HH:MM")  'yields 14:12
  2.  Format(YourTime, "HH:MM ampm")   'yields 02:12 PM
As for sorting /displaying classes, assuming you have a record for each class, in your query, make sure Day of Class is to the left, in the Query Grid, of the Time of Class, and sort by both.

Linq ;0)>
Aug 31 '07 #2

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

Similar topics

3
by: AttiDude | last post by:
Hi, I need some help with some code. I need to know how long the computer is online or how long the user has been logged in. Ok I have a few options: -Take a file that has been created at...
1
by: Sorisio, Chris | last post by:
Ladies and gentlemen, I've imported some data from a MySQL database into a Python dictionary. I'm attempting to tidy up the date fields, but I'm receiving a 'mx.DateTime.Error: cannot convert...
3
by: Filip Lyncker | last post by:
Hi group , I need a function to convert a given local time to the correct Universal Time ( UTC/GMT). The problem is the Daylight Saving Times(DST). Unix/Linux uses the Olson TZ database wich...
0
by: sumeet | last post by:
how do i convert a yyyymmdd format to yyyy,mm,dd format. also i want to know how do i get the number of days between two dates which r in the format yyyymmdd. how to convert date into unix time...
7
by: Robert Misiak | last post by:
Hello- I live in the US, however I'm attempting to make a product of mine more international-friendly. There are a number of instances where a calendar function of my program displays various...
6
by: Dogmar Hoffman | last post by:
Hello, I am trying to use tostring to convert to a 24 hour time format, but am getting the error "No Overload for Method 'ToString'takes '1' arguments". The following is what I have and it...
1
by: getnitha | last post by:
how to convert a number to time format in vb.net eg: 8 to 8:00:00 i am storing in sql server number as nvarchar while retreiving in code i need to convert it as 8:00:00 for further calculations...
2
by: Renee Zarazinski | last post by:
I have two fields Time-in & Time-out that are in military time. I have to calculate the difference (to get the total amt. of time spent working) then show the time as clock time. I've only been...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
7
by: brainbox | last post by:
I have 2 questions: 1.When I read the number using (\S+) its getting stored as 2.08E13. Code I used: if ($line=~/4_begindt_(\S+)/) { print "$1\n" } # $1=2.08E13; instead $1 should contain...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.