Results 1 to 3 of 3

Thread: Converting from _variant_t to Date

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Malaysia
    Posts
    5

    Converting from _variant_t to Date

    How can I convert the variant into date??


    _variant_t vTDate;

    // Get the date from database
    vTDate = rst->GetCollect(L"TDATE");

    /*
    From the result I got,
    vTDate = {21/03/2001 12:00:00 AM VT_DATE}
    vTDate.date = 36971.000000000
    */

    Please help

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Try using the ctime or _wctime. Both are return char and wchar_t

    regards,

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Malaysia
    Posts
    5
    I think I didn't make myself clear.

    What I want from the return value is in fact in date format. I can convert it to CString from variant type, but don't know how to convert it to date format.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width