Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Loose time portion of date when table updated

Discussion in 'Information Technology' started by Ogetty, Jul 28, 2006.

  1. Ogetty

    Ogetty
    Expand Collapse
    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.
     
  2. Loading...

    Similar Threads Forum Date
    Politics Time to Cut Mideast Dictators Loose Breaking News Jan 30, 2011
    Sikh News Former Punjab DGP Virk arrested in disproportionate assets case (ANI via Yahoo! India Breaking News Sep 9, 2007
    Sikh News NCERT withdraws 4 books, rewrites portions on Sikh figures (New Kerala) Breaking News Feb 2, 2006

  3. Jerry Whittle

    Jerry Whittle
    Expand Collapse
    Guest

    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.
    --
    Jerry Whittle
    Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


    "Ogetty" wrote:

    > 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.
    >
     
  4. Ogetty

    Ogetty
    Expand Collapse
    Guest

    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.

    "Jerry Whittle" wrote:

    > 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.
    > --
    > Jerry Whittle
    > Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
    >
    >
    > "Ogetty" wrote:
    >
    > > 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.
    > >
     

Share This Page