C++ ctime

Stop copy pasting code you don't actually understand

Build the coding confidence you need to become a developer companies will fight for

Stop copy pasting code you don't actually understand

Start FREE Trial Start FREE Trial

Start FREE Trial Start FREE Trial

Stop copy pasting code you don't actually understand

Build the coding confidence you need to become a developer companies will fight for

Stop copy pasting code you don't actually understand

Start FREE Trial Start FREE Trial

Start FREE Trial Start FREE Trial

Python JavaScript TypeScript SQL HTML CSS C C++ Java R Ruby RUST Golang Kotlin Swift C# DSA

Learn

Practice

Compete

Certification Courses

Created with over a decade of experience and thousands of feedback.

Python

JavaScript

TypeScript

SQL

HTML

CSS

C

C++

Java

More languages

Python

JavaScript

C

C++

Java

R

Kotlin

The C++ <ctime> header file declares a set of functions, macros and types to work with date and time. For example, the time() function is used to get the current time.

C++ asctime()

converts calendar time to character representation

C++ clock()

returns processor time consumed by program

C++ ctime()

converts time since epoch to char representation

C++ difftime()

computes difference between two times in seconds

C++ gmtime()

converts given time since epoch to UTC time

C++ localtime()

converts given time since epoch to local time

C++ strftime()

converts calendar time to multibyte character str

C++ time()

Returns current calendar time