[go: up one dir, main page]

0% found this document useful (0 votes)
63 views2 pages

C Date and Time Functions

The C date and time functions are part of the standard library in C, defined in the time.h header file, and facilitate date and time manipulation. Key functions include difftime for calculating time differences, asctime and ctime for converting time values to textual formats, and localtime and gmtime for converting time values to local or UTC formats. Additional functions like strftime and strptime allow for custom formatting and parsing of date and time strings.

Uploaded by

maccu1234nitin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views2 pages

C Date and Time Functions

The C date and time functions are part of the standard library in C, defined in the time.h header file, and facilitate date and time manipulation. Key functions include difftime for calculating time differences, asctime and ctime for converting time values to textual formats, and localtime and gmtime for converting time values to local or UTC formats. Additional functions like strftime and strptime allow for custom formatting and parsing of date and time strings.

Uploaded by

maccu1234nitin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C date and time functions

The C date and time functions are a group of functions in the standard library of
the C programming language implementing date and time manipulation
operations.They provide support for time acquisition, conversion between date
formats, and formatted output to strings.

The C date and time operations are defined in the time.h header file

difftime computes the difference in seconds between two time values

returns the current time of the system as a time value, number of


time
seconds

clock returns a processor tick count associated with the process

timespec_get returns a calendar time based on a time base

asctime converts a struct tm object to a textual representation

ctime converts a time value to a textual representation

strftime converts a struct tm object to custom textual representation

strptime converts a string with time information to a struct tm

converts a struct tm object to custom wide string textual


wcsftime
representation
converts a time value to calendar time expressed as Coordinated
gmtime
Universal Time

localtime converts a time value to calendar time expressed as local time

mktime converts calendar time to a timevalue.

You might also like