LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Convert string to military time string

I would like to hear everyone's techniques for converting
a string into military time format ONLY if the string resembles
a standard time format.

For example,

"12:00am" -- "0000"
"8:45 pm" -- "1945"
"1:22 PM" -- "1322"
"3 : 36 p m -- "1546"
"2:00" -- "0200" [special case]
"hello" -- "0000" [special case]

In the special cases where a user forgets to
type "am", "AM", "pm", or "PM", I will want to
covert as shown above (morning military time).

If the string does not resemble a standard time
format, then we can just convert that to "0000" hours.






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert now (current date and time) to a string ddmmyyyyhhnn. David Langschied Excel Programming 2 November 5th 08 12:34 PM
convert string to date & time [email protected] Excel Worksheet Functions 4 October 30th 06 04:26 PM
Convert to Military time? telewats Excel Discussion (Misc queries) 2 March 13th 06 06:17 PM
Function to convert Time String to Time Andibevan Excel Worksheet Functions 6 August 19th 05 01:19 PM
Convert to military time - part II Carole O Excel Programming 6 August 14th 04 01:55 AM


All times are GMT +1. The time now is 06:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"