Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6337651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:17:31+00:00 2026-05-24T19:17:31+00:00

I am getting input from a file. The time maybe military or standard (AM/PM)

  • 0

I am getting input from a file. The time maybe military or standard (AM/PM)

I need to convert the time to military.

Here are some examples of the time in the CSV file

2011-08-16, 2:28:00 PM, 15:28
2011-08-16, 1:21:00 PM, 13:28
2011-08-16, 2:13:00 PM, 16:28
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:17:33+00:00Added an answer on May 24, 2026 at 7:17 pm

    Firstly I’m not sure whether I understood the question correctly.
    Could be like this:

    Option Explicit
    
    Const SOURCE_PATH = "C:\source.csv"
    Const DEST_PATH = "C:\destination.csv"
    Dim oReg, oFso
    
    Set oReg = New RegExp
    oReg.IgnoreCase = True
    oReg.Global = True
    oReg.Pattern = "\b((1[0-2]|[1-9]):[0-5][0-9]:[0-5][0-9] [AP]M)\b"
    
    Function cb_MilTime(a, b, c, d, e)
        cb_MilTime = FormatDateTime(CDate(b), 4)
        'cb_MilTime = Replace(cb_MilTime, ":", "") 'need seperator?
    End Function
    
    Set oFso = CreateObject("Scripting.FileSystemObject")
    
    If oFso.FileExists(SOURCE_PATH) Then 
        oFso.OpenTextFile(DEST_PATH, 2, True).Write(oReg.Replace(_
        oFso.OpenTextFile(SOURCE_PATH).ReadAll(), GetRef("cb_MilTime")))
    Else 
        Err.Raise 8, "Source path does not exists"
    End If
    
    WScript.Echo "File Saved to "& DEST_PATH
    
    Set oFso = Nothing
    Set oReg = Nothing
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is the input i am getting from my flash file process.php?Q2=898&Aa=Grade1&Tim=0%3A0%3A12&Q1=908&Bb=lkj&Q4=jhj&Q3=08&Cc=North%20America&Q0=1 and in
When I input locations from a txt file I am getting a peculiar error
I'm having some trouble with getting input from the command line before opening a
I'm getting dates & times from various sources (e.g. file's date/time from FTP server,
I am designed a dynamic table for getting input from user. Each column of
I'm using ncurses for simple UI that involves getting input from the user. The
I'm currently having some trouble with getting certain input fields passed along when a
I'm getting pretty big input string into my method, but what I actually need
Problem! I Have the following input (rules) from a flat file (talking about numeric
I'm getting started with using python's mrjob to convert some of my long running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.