PC Review


Reply
Thread Tools Rate Thread

Converting Time

 
 
JT
Guest
Posts: n/a
 
      1st Oct 2008
I get a file that displays time as 0515A. I need to convert it to 05:15 AM.
I use the mid function to retrieve the hour, minutes and A or P. I then
rebuild the string as 05:15 AM and write it to a cell.

Before writing it to a cell, I format the cell as "hh:mm AM/PM".

When I look at the cell, I see 05:15 AM. However, the actual cell value is
05:15:00 AM.

Is there a format or way to make the actual cell value as 05:15 AM instead of
05:15:00 AM?

Thanks for the help......
--
JT
 
Reply With Quote
 
 
 
 
dmoney
Guest
Posts: n/a
 
      1st Oct 2008
Format as text as you are building a text string.
dm

"JT" wrote:

> I get a file that displays time as 0515A. I need to convert it to 05:15 AM.
> I use the mid function to retrieve the hour, minutes and A or P. I then
> rebuild the string as 05:15 AM and write it to a cell.
>
> Before writing it to a cell, I format the cell as "hh:mm AM/PM".
>
> When I look at the cell, I see 05:15 AM. However, the actual cell value is
> 05:15:00 AM.
>
> Is there a format or way to make the actual cell value as 05:15 AM instead of
> 05:15:00 AM?
>
> Thanks for the help......
> --
> JT

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      1st Oct 2008
> Format as text as you are building a text string.

....or leave it the way you have it now (as a date), but use the Text
property of the Range object when building a text string in code (VBA); or
use the TEXT function to format it the way you want when building a text
string in a worksheet formula.

--
Rick (MVP - Excel)

 
Reply With Quote
 
Socko
Guest
Posts: n/a
 
      1st Oct 2008
Actually when you enter the time as 05:15 AM, for excel the actual
cell value will be 05:15:00 AM as excel assumes that second part is
zero as you have not mentioned it.

I believe, there is nothing wrong if excel shows seconds as zero.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula for converting military time to standard time, etc Pattio Microsoft Excel Misc 8 17th Feb 2008 01:12 AM
Converting date/time serial values to cumulative time totals... =?Utf-8?B?S2V2aW4gQg==?= Microsoft Excel Misc 4 18th Oct 2007 05:09 PM
Converting Local Time to Universal Coordinated Time =?Utf-8?B?SmltIE9yeQ==?= Microsoft Access 14 10th May 2007 05:02 PM
Converting time formats into actual time(minutes) =?Utf-8?B?TGVpZ2hN?= Microsoft Excel Misc 2 30th Oct 2006 05:15 AM
Converting from string to time and subtracting two time fields Anamik Microsoft Access Queries 1 27th Oct 2004 02:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:44 AM.