vba string to date

Dim myDate As Date, strDate As String
myDate = CDate("2021-01-28")
strDate = Format(myDate, "YYYY-MM-DD")				  ' 2021-01-28
' String to date
myDate = CDate(Format$("20210213101235", "####-##-## ##:##:##"))
' Date to string
strDate = Format(myDate, "YYYY-MM-DD hh:mm:ss")       ' 2021-02-13 10:12:35

4.44
9
Caleb Koch 70 points

                                    Dim iDate As String = "05/05/2005"
Dim oDate As DateTime = Convert.ToDateTime(iDate)
MsgBox(oDate.Day & " " & oDate.Month & "  " & oDate.Year)

4.44 (9 Votes)
0
3.88
8
Noah Tall 90 points

                                    string iDate = "05/05/2005";
DateTime oDate = Convert.ToDateTime(iDate);
MessageBox.Show(oDate.Day + " " + oDate.Month + "  " + oDate.Year );

3.88 (8 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
string to date vb6 string to date vb how to convert a string to date in vb.net vb convert date() to date vb.net conversion from string to date convert to date vba CONVERT STRING TO DATE vba CONVERT STRING TO DATE SISTEM vba how to convert string to date vba vba extract date from string convert string date into date in vba ms access how to convert string to date in vb.net from string to date vb net vb6 string to date conversion convert string to time vba excel convert to a date vba string to date vba convert string to date vba convert string to date using vba converting string to date in vba vba new date from string VBA Date to date vba date from string with format vb convert string to date vb.net convert string in date how to convert date in vba code convert string to date vb net convert string into date VB 2017 convert string into date VB how to convert string to date vb.net how to convert string into date in vb.net how to convert text to date in vba string to date vb.net convert string to date VB parse string to date VB convert to date value vba convert date string to date frmat access vba VBA convert string to a date access vba convert string to date excel vba format string to date vb string date to date string to time in vba convert string to date vb.net vb convert string date to datetime vb convert string date to date type excel vba string to date vba convert string to date string to Date convert VB vba string to datetime vba text to date vba date from string vb convert to date convert string date result c# vba get date as string string to datetime xc# get if string can be converted to date vb.net vba convert string to date 01 Jan 2021 vba convert string to date dd/mm/yyyy convert date to written c# get datetime from string vb.net convert string to datetime convert to datetime Convert to date time converting string to datetime vb.net convert string to timestamp string to date time how to convert string to date c# convert string to datetime visual basic convert time string to time visual basic date covert in c# create date from string vb convert date string to datetime asp.net convert string to datetime c' convert a string to datetime in c# string date format convert c# cast string as datetime vb.net parst string from date c# new date from string c# converrt to date type vb.net convert string to date vb.net string to date asp.net string to datetime csharp convert string to datetime how to convert a string to date time create datetime from string c# vba string to date how to parse string date in c# c# change string to date vb.net date convert parse datetime object to string c# date parse string to datetime convert date sring to date time string to datetime convert string to date in vb.net vb convert to datetime format how to convert string to date time in vb.net convert string time to datetime and compare with other date on asp.net converting text to date in vb.net convert input date in c# convert string to time duration vb.net asp.net convert string to datetime visual basic converting string to date convert string to string date time c# how to change string to date time how to convert sring to datetime in c# how to convert sring to datetime convert from string to datetime string to datetime asp.net c# razor convert string to datetime vb.net date from string date string date to date c# class to convert string date to datetime in c# how to parse string to datatime c# construct datetime from string c# parse string date to date c# string to datetime en vb.net convert string time to datetime string convert to datetime c# get year how to replace text in a datetime vb.net convert string in datatime in c# cast as time in vb.net c# convert string to datetime specific input format c# convert string to datetime specific format string into datetime in C# c# convert datetime C# convert string to datetime with month c# turn a string to datetime format c# how to parse string datetime in c# c# format string to date sconvert string to date c# convert ti date format .net how to convert string into date time how to convert string to date time create date from string c# how to convert date string to date part in c# how to convert date string to date in c# date time i a string how to convert it convert a string in to a date c# string to date in c# convert str iunto date time convert datetime from string to c# datatime convert string to datetime format of fest c# convert string to datetimeformatoffest c# c# string date to datetime how to convert string to date time in c# vb.net string to datetime culture us vb.net convert string to date culture how to convert value to date in c# string to date and time convert vb format string to date vb string to date string to date conversion in c# vb.net convert string to date mm/dd/yyyy convert.todatetime in vb.net mm/dd/yyyy get date time from a string c# cast string to date
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source