Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Anyone know how to convert from string to time?

Anyone know how to convert from string to time?

Scheduled Pinned Locked Moved Visual Basic
questionhelptutorial
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 1934105
    wrote on last edited by
    #1

    Anyone know how to convert from string to time? I have a dropdown list that contain a list of time. When I retrieve the value selected by user, but the problem is the value return from the dropdown list is in text/string. How can I convert it to time? Thank you very very much in advance for reply my question.

    R T 2 Replies Last reply
    0
    • U User 1934105

      Anyone know how to convert from string to time? I have a dropdown list that contain a list of time. When I retrieve the value selected by user, but the problem is the value return from the dropdown list is in text/string. How can I convert it to time? Thank you very very much in advance for reply my question.

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Depends on the format but you could try: Convert.ToDateTime(myString)

      G 1 Reply Last reply
      0
      • R Robert Rohde

        Depends on the format but you could try: Convert.ToDateTime(myString)

        G Offline
        G Offline
        gemnet
        wrote on last edited by
        #3

        dim now as datetime = datetime.now dim temp as string temp = now.tostring Stephen May

        R 1 Reply Last reply
        0
        • G gemnet

          dim now as datetime = datetime.now dim temp as string temp = now.tostring Stephen May

          R Offline
          R Offline
          Robert Rohde
          wrote on last edited by
          #4

          So what are you trying to tell me with this? :confused: The question was how to convert string to time and not time to string like you did.

          G 1 Reply Last reply
          0
          • R Robert Rohde

            So what are you trying to tell me with this? :confused: The question was how to convert string to time and not time to string like you did.

            G Offline
            G Offline
            gemnet
            wrote on last edited by
            #5

            sorry, long day Use the old standby cdate(string)=datetime or use dateserial(year,month,day) If you only want the time portion then format(cdate(string),formatstring)

            1 Reply Last reply
            0
            • U User 1934105

              Anyone know how to convert from string to time? I have a dropdown list that contain a list of time. When I retrieve the value selected by user, but the problem is the value return from the dropdown list is in text/string. How can I convert it to time? Thank you very very much in advance for reply my question.

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              why don't you use Time.Parse(MyString) ?


              TOXCCT >>> GEII power
              [toxcct][VisualCalc]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups