Loose time portion of date when table updated

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When a DataSet date is changed and the DataTable updated, the table appears
to loose the time portion entered and default to midnight.I have set the
table format to general time to view the entire date and the date portion
gets carried over but the time is always 12:00 AM.

The DataSet cell is changed to an arbitrary Date portion and the Time
portion is appended to it and then the table updated.

I have tried several schemes to append/add the time portion to the date
portion but all fail . ie:-DatePortion.add(Time as timeSpan),
DatePortion &" " & Cdate(TimePortion.text)

I am sure this is a simple fundamental issue I am missing.
Thanks for any direction here.
 
What code does the updating? I bet that it's using the Date() function. Try
the Now() function which includes both the date and time.
 
ie:
dim lblTxt as string
dim dateTime1 as DateTime
dim dateDate as DateTime
dim totDate as datetime

dateDate = #1/1/2000# 'arbitrary, I thaught needed to fill out a
full Date
lblTxt = myLabel.text ' this will resemble "4:30 AM"
dateTime 1=CDate( lblTxt)

dim timeTs as new TimeSpan(dateTime1.hour,0,0)'?? I think this is correct??

totDate= dateDate.add(TimeTs)
dsXXX.tblXXX(row)(col)=totDate
daXXX.update(dsXXX)

The end result is to have a table filled with dates with the correct Time
portions where the Time portion will be used to build daily schedules etc.
ie, on any given date a person may be available from 9:00 AM to 4:30 PM.
These times would be attached to whatever date this is.

There may be an easier approach altogether.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top