Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[3244] How to convert a string to a date

Last post 09-13-2007 8:14 AM by ravi_fss. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [3244] How to convert a string to a date

    This thread is for discussions of How to convert a string to a date.

    • Post Points: 40
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 02-28-2003 2:19 PM In reply to

    • svy
    • Not Ranked
    • Joined on 02-28-2003
    • New Member
    • Points 15

    easy way to do that :0

    DateTime dtDate = Convert.ToDateTime(strDate);

    "Convert" is a class in a "System" namespace.
    • Post Points: 0
  • 04-16-2003 11:54 AM In reply to

    Another Way is Also
    DateTime dt = DateTime.Parse(strdate);



    • Post Points: 0
  • 12-01-2003 11:40 AM In reply to

    • snu155
    • Not Ranked
    • Joined on 12-01-2003
    • New Member
    • Points 5

    a simple VB.Net string to Date Time conversion

    'Make sure that your date is correct, if you try for example to do "11/31/03"
    'you will get an error because november only has 30 days to it the correct string
    'is "11/30/2003"

    dim dateString as string = "11/30/2003"

    dim convertedDate as Date = CDate(dateString)
    • Post Points: 0
  • 12-22-2003 6:18 AM In reply to

    • dob
    • Not Ranked
    • Joined on 12-22-2003
    • New Member
    • Points 25
    How can i get just date part (22/12/2003) out of datetime(22/12/2003/ 1:23:00 PM) without convert to string datetypes (ShortDateString etc).
    for instance if ur passing datetime parameters to stored procedures that perform search based on dates supplied.
    Passing dates with time would not show last record coz it compares with time too.

    • Post Points: 0
  • 04-19-2005 10:41 AM In reply to

    • soz
    • Not Ranked
    • Joined on 04-19-2005
    • New Member
    • Points 5

    How do i convert a string to a time

    I've tried this piece of code:

    DateTime startTime;

    start = Convert.ToDateTime(startTimePicker.Text);

    Console.WriteLine(startTime.ToLongTimeString());

    The problem with this is that the results are string values but i want the actual time value in order to be able to use it to compare times to prevent overlaps in meeting times.
    • Post Points: 0
  • 06-14-2005 1:22 PM In reply to

    • sanepete
    • Not Ranked
    • Joined on 06-14-2005
    • New Member
    • Points 10

    Convert.DateTime

    Svy,
    Cheers mate that one had thus far eluded me.
    • Post Points: 0
  • 06-17-2005 2:06 AM In reply to

    • dateformats
    • Not Ranked
    • Joined on 10-09-2004
    • United States
    • New Member
    • Points 10

    Date Programming/Conversions. Still the Working Solution or Answer!

    Hey, to ALL Developers and Programmers,

     

      Here's a simple and easy way of solving all your Date Programming and Conversion  problems.


    Developer's Dateware offers a much greater variety of date features, versus what is offered in typical programming environments.  You will not need to fuss with the PC's Locale system any longer – these features will do it for you.  These Date functions range from general areas to specific areas.


    Developer's Dateware offers: 
       1)  simplicity in performing any kind of Date Operation.
       2)  much more capabilties,  for a lot less money.
       3)  Excellent
    Results and Performance are Guaranteed .
                   And yet, we’ll beat the rest! 
       4)   supports many different date formats... 

    Are you ready to take a challange for something new and much better?

     

    DateFormats,      and yes, I’m still around…

     

    The software is written in MSVC++ v6.0,  (with NO MFC Code).

     

    For Further Details about Developer's Dateware Software and demo,

            contact Thad at:  auroraprojectusaf@yahoo.com

       --6/22/2008--

    • Post Points: 10
  • 09-13-2007 8:14 AM In reply to

    • ravi_fss
    • Not Ranked
    • Joined on 04-13-2006
    • India
    • New Member
    • Points 30

    Re: Date Programming/Conversions, A Working Solution!

    'Converts the date in format dd/MM/yyyy to date format in MM/dd/yyyy

    Dim stDate As String = "31/12/2006"

    Dim dtDate As Date

    dtDate = DateTime.Parse(stDate, Globalization.CultureInfo.CreateSpecificCulture(

    "en-CA"))

    MsgBox(dtDate)

    • Post Points: 5
Page 1 of 1 (9 items)