retrieving time from dataset

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • charvi
    New Member
    • May 2007
    • 121

    retrieving time from dataset

    hi
    i have textbox which is used to input time. and in databsae it stores in hh:nn format when i am saving after entering time it stores in time format.
    i used dataset to retrive the data from tables to appropriate text box. everything works fine only time is displaying as 01/01/1899 instead it should be 15:12
    pls suggest how to correct this
    i am using normal textbox in front end i am doing project in vb.net
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi charvi,

    You can use the following snippet to format your datetime variable:
    Code:
     txtTime.Text = Date.Parse(Date.Now).ToShortTimeString
    Hope this helps,

    Dr B

    Comment

    Working...