পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Thursday, January 26, 2017

C Library -

The time.h header defines four variable types, two macro and various functions for manipulating date and time.

Library Variables

Following are the variable types defined in the header time.h:
S.N. Variable & Description
1 size_t
This is the unsigned integral type and is the result of the sizeof keyword.
2 clock_t
This is a type suitable for storing the processor time.
3 time_t is
This is a type suitable for storing the calendar time.
4 struct tm
This is a structure used to hold the time and date.
The tm structure has the following definition:
struct tm {
   int tm_sec;         /* seconds,  range 0 to 59          */
   int tm_min;         /* minutes, range 0 to 59           */
   int tm_hour;        /* hours, range 0 to 23             */
   int tm_mday;        /* day of the month, range 1 to 31  */
   int tm_mon;         /* month, range 0 to 11             */
   int tm_year;        /* The number of years since 1900   */
   int tm_wday;        /* day of the week, range 0 to 6    */
   int tm_yday;        /* day in the year, range 0 to 365  */
   int tm_isdst;       /* daylight saving time             */
};

Library Macros

Following are the macros defined in the header time.h:
S.N. Macro & Description
1 NULL
This macro is the value of a null pointer constant.
2 CLOCKS_PER_SEC
This macro represents the number of processor clocks per second.

Library Functions

Following are the functions defined in the header time.h:
S.N. Function & Description
1 char *asctime(const struct tm *timeptr)
Returns a pointer to a string which represents the day and time of the structure timeptr.
2 clock_t clock(void)
Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
3 char *ctime(const time_t *timer)
Returns a string representing the localtime based on the argument timer.
4 double difftime(time_t time1, time_t time2)
Returns the difference of seconds between time1 and time2 (time1-time2).
5 struct tm *gmtime(const time_t *timer)
The value of timer is broken up into the structure tm and expressed in Coordinated Universal Time (UTC) also known as Greenwich Mean Time (GMT).
6 struct tm *localtime(const time_t *timer)
The value of timer is broken up into the structure tm and expressed in the local time zone.
7 time_t mktime(struct tm *timeptr)
Converts the structure pointed to by timeptr into a time_t value according to the local time zone.
8 size_t strftime(char *str, size_t maxsize, const char *format, const struct tm *timeptr)
Formats the time represented in the structure timeptr according to the formatting rules defined in format and stored into str.
9 time_t time(time_t *timer)
Calculates the current calender time and encodes it into time_t format.

No comments:

Post a Comment