VOOZH about

URL: https://www.geeksforgeeks.org/cpp/print-system-time-c-3-different-ways/

⇱ Print system time in C++ (3 different ways) - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Print system time in C++ (3 different ways)

Last Updated : 10 Dec, 2018
First Method Printing current date and time using time() Second Method Output:
It will show the current day, date and localtime, 
in the format Day Month Date hh:mm:ss Year
Third Method Here we have used chrono library to print current date and time . The chrono library is a flexible collection of types that tracks time with varying degrees of precision . The chrono library defines three main types as well as utility functions and common typedefs. -> clocks -> time points -> durations Code to print current date, day and time .
Output:
It will show the current day, date and localtime, 
in the format Day Month Date hh:mm:ss Year
Comment
Article Tags: