?
Solved

How to Convert String Date & Time parameters into DATE type

Posted on 2001-06-26
7
Medium Priority
?
996 Views
Last Modified: 2013-11-20
I have a string value that represents a date in the format "dd/mm/yy", and a time value representing the time in the format "hh:mm".  What I need to do is combine and convert them into a DATE value.

I've looked at the VarDateFromStr() function, and it seems to do the job, but I need to know what the date and time string for the first parameter (strIn) will look like.

Any examples would be much appreciated.
0
Comment
Question by:carlpaddick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 12

Accepted Solution

by:
migel earned 300 total points
ID: 6227326
hi!
look at MSDN:
PRB: VarDateFromStr Does Not Consider Date Formats for Specific Locales
ID: Q241893      

"...
The function returns without error if the passed string is valid in any of the following date formats:
DD-MM-YYYY

MM-DD-YYYY

YYYY-MM-DD

..."
0
 

Author Comment

by:carlpaddick
ID: 6227354
Can you give me the URL for this migel?  Also does it illustrate the combining of the date and times for they are passed to VarDateFromStr?
0
 
LVL 12

Expert Comment

by:migel
ID: 6227403
here is link:
http://support.microsoft.com/support/kb/articles/Q241/8/93.ASP
time can be parsed when you specify
VAR_TIMEVALUEONLY
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:carlpaddick
ID: 6227435
Thanks.
0
 

Author Comment

by:carlpaddick
ID: 6230596
migel,

Can you (or anyone else) tell me how you set the time value for the VarDateFromStr function?

It seems that one can use the hyphen character to separate the date value, such as:

27-06-01 or 06-26-01

Does anyone know if the time value's hours and minutes parameters must be separated by a colon(:), such as:

07:30 or 18:45

or another character?
0
 

Author Comment

by:carlpaddick
ID: 6237720
Don't worry about the last comment/question - sorted it myself.

Carl
0
 

Author Comment

by:carlpaddick
ID: 6237729
With your helpful MSDN document migel and a bit of experimenting myself, I have sorted out my problem.  You were the only person to contribute towards this question, so the points are yours.

Thanks for your help and keep up the good work,

Carl
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question