Date Data Type in TURBO C


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Date Data Type in TURBO C

  1. #1
    Toms Ng Guest

    Date Data Type in TURBO C


    Hello,
    I am a VFP programer , and starting my C life.
    I want to know how can i get the date data type in TURBO C. How to get the
    different between two date's value.If i save the value(string data type)
    to a .dat file , how can i convert it into a date data type.

    Can anyone help me
    Toms


  2. #2
    Danny Kalev Guest

    Re: Date Data Type in TURBO C

    Fortunately, Turbo C supports the <time.h> library. You can read here
    how to use it to obtain the current date and time, format, compare dates
    etc.
    http://gethelp.devx.com/techtips/cpp.../10min1200.asp

    Danny

    Toms Ng wrote:
    >
    > Hello,
    > I am a VFP programer , and starting my C life.
    > I want to know how can i get the date data type in TURBO C. How to get the
    > different between two date's value.If i save the value(string data type)
    > to a .dat file , how can i convert it into a date data type.
    >
    > Can anyone help me
    > Toms


  3. #3
    Toms Ng Guest

    Re: Date Data Type in TURBO C


    How about Borland C or simple C ,
    is it support <time.h>

    Toms

    Danny Kalev <dannykk@inter.net.il> wrote:
    >Fortunately, Turbo C supports the <time.h> library. You can read here
    >how to use it to obtain the current date and time, format, compare dates
    >etc.
    >http://gethelp.devx.com/techtips/cpp.../10min1200.asp
    >
    >Danny
    >
    >Toms Ng wrote:
    >>
    >> Hello,
    >> I am a VFP programer , and starting my C life.
    >> I want to know how can i get the date data type in TURBO C. How to get

    the
    >> different between two date's value.If i save the value(string data type)
    >> to a .dat file , how can i convert it into a date data type.
    >>
    >> Can anyone help me
    >> Toms



  4. #4
    ralph Guest

    Re: Date Data Type in TURBO C


    "Toms Ng" <tomsng@sinaman.com> wrote:
    >
    >How about Borland C or simple C ,
    >is it support <time.h>
    >
    >Toms
    >
    >Danny Kalev <dannykk@inter.net.il> wrote:
    >>Fortunately, Turbo C supports the <time.h> library. You can read here
    >>how to use it to obtain the current date and time, format, compare dates
    >>etc.
    >>http://gethelp.devx.com/techtips/cpp.../10min1200.asp
    >>
    >>Danny
    >>
    >>Toms Ng wrote:
    >>>
    >>> Hello,
    >>> I am a VFP programer , and starting my C life.
    >>> I want to know how can i get the date data type in TURBO C. How to get

    >the
    >>> different between two date's value.If i save the value(string data type)
    >>> to a .dat file , how can i convert it into a date data type.
    >>>
    >>> Can anyone help me
    >>> Toms

    >


    Don't Panic. <g>

    Most mainstream compilers today include <time.h>/<ctime> which is part of
    the C Standard Library and adopted wholesale by ANSI/ISO C++. I think what
    Danny may have been referring to is the fact that not all earlier compilers
    did have a <time.h>, some offered their own time libraries.

    In C/C++ you will find there are a huge variety of time routines now at your
    disposal - C Standard Library, System/API time, time classes, etc.

    One caveat about "time" - you should never take times too seriously in your
    program.

    Another is to never "mix 'n match" time "libaries", i.e., don't attempt to
    critically compare a file system time with say a "clock_t", or a SQL Server
    timestamp. Not unless there is a sufficient "interval" involved to expect
    that a reasonable approximation of difference can be found.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center