UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What are the __DATE__ and __TIME__ preprocessor commands?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

Professional Tutor with 15 years of experience.

The standard predefined macros are specified by the relevant language standards, so they are available with all compilers that implement those standards. Older compilers may not provide all of them. Their names all start with double underscores. __DATE__ This macro expands to a string constant that...
read more
The standard predefined macros are specified by the relevant language standards, so they are available with all compilers that implement those standards. Older compilers may not provide all of them. Their names all start with double underscores. __DATE__ This macro expands to a string constant that describes the date on which the preprocessor is being run. The string constant contains eleven characters and looks like "Feb 12 1996". __TIME__ This macro expands to a string constant that describes the time at which the preprocessor is being run. The string constant contains eight characters and looks like "23:59:01". read less
Comments

Thank You for your Questions.... _DATE_ macro expands to a string constant that describes the date on which the pre-processor is being run whereas _TIME_ macro expands to a string constant that describes the time at which the pre-processor is being run. Thanks, Team DishaaPro
Comments

Learn by doing it. No theory Only Practical

Preprocessor is first statement that get executed. It tells compiler to pre-process before compilation. _DATE --> The current date as a character literal in "MMM DD YYYY" format. and The current time as a character literal in "HH:MM:SS" format. you can use them as below : void main() { printf("Date...
read more
Preprocessor is first statement that get executed. It tells compiler to pre-process before compilation. _DATE --> The current date as a character literal in "MMM DD YYYY" format. and The current time as a character literal in "HH:MM:SS" format. you can use them as below : void main() { printf("Date :%s\n", __DATE__ ); printf("Time :%s\n", __TIME__ ); } read less
Comments

Experienced faculty in C with data structures and C++ with Data Structures,Linux Admin with Advance linux concepts

__DATE__ and __TIME are global identifiers __DATE__ returns string literal Date for when the processing begins on that file __TIME__ return string literal Time for when the processing begins on that file.
Comments

C and linux Expert

__DATE_ macro show current date as a character in "MMM DD YYYY" format. __TIME__ macro show current time as a character in "HH:MM:SS" format.
Comments

The __DATE__ macro is used to insert the current compilation date in the form "mm dd yyyy" into your program. Similarly, the __TIME__ macro is used to insert the current compilation time in the form "hh:mm:ss" into your program. This date-and-time-stamp feature should not be confused with the current...
read more
The __DATE__ macro is used to insert the current compilation date in the form "mm dd yyyy" into your program. Similarly, the __TIME__ macro is used to insert the current compilation time in the form "hh:mm:ss" into your program. This date-and-time-stamp feature should not be confused with the current system date and time. Rather, these two macros enable you to keep track of the date and time your program was last compiled. This feature can come in very handy when you are trying to track different versions of your program. For instance, many programmers like to put a function in their programs that gives compilation information as to when the current module was compiled. This task can be performed as shown here: #include stdio.h void main(void); void print_version_info(void); void main(void) { print_version_info(); } void print_version_info(void) { printf("Date Compiled: %s\n", __DATE__); printf("Time Compiled: %s\n", __TIME__); } read less
Comments

Professional Trainer:: Hadoop Big Data, DevOps, Perl, Python

__DATE__ A character string literal containing the date when the source file was compiled. The date will be in the form: "Mmm dd yyyy" where: Mmm represents the month in an abbreviated form (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, or Dec). dd represents the day. If the day...
read more
__DATE__ A character string literal containing the date when the source file was compiled. The date will be in the form: "Mmm dd yyyy" where: Mmm represents the month in an abbreviated form (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, or Dec). dd represents the day. If the day is less than 10, the first d will be a blank character. yyyy represents the year. __TIME__ Defined as a character string literal containing the time when the source file was compiled. The time will be in the form: "hh:mm:ss" where: hh represents the hour. mm represents the minutes. ss represents the seconds. read less
Comments

Computer & Maths Professor

__DATE__ prints the current date in "MMM DD YYYY" format. _TIME_ prints the current time in "HH:MM:SS" format.
Comments

The __DATE__ macro is used to insert the current compilation date in the form "mm dd yyyy" into your program. The __TIME__ macro is used to insert the current compilation time in the form "hh:mm:ss" into your program.
Comments

Mathematics and Computer science guide

_DATE__ The current date as a character literal in "MMM DD YYYY" format. __TIME__ The current time as a character literal in "HH:MM:SS" format. printf("File :%s\n", __FILE__ ); printf("Date :%s\n", __DATE__ );
Comments

View 24 more Answers

Related Questions

In how many days can we learn the C language?
Around one month and depends upon you how much time you give.
Ravi Shankar
0 0
9
Can a function defined inside another function?
No, you can call other function(s) inside a function but you cannot define a new function in it.
Kamal
0 0
8
What is the meaning of \n and \t in C language?
is used for new line and \t is used to give 3-space (1 tab space) in between the words
Soumya
0 0
5
How do I learn C programming effectively? What is the best book?
C: The Complete Reference is written by Herbert Schildt is one of the best book for beginners
Sk
0 0
7

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Some interview questions for freshers on C language
Q1. What are the two forms of #include? There are two variants of #include. The one is #include and the other one is #include”file”. In general the first form that is #include is used to...

C, Cpp, Java, Python, Javascript Programming Languages
Learning C is as good as Learning a Natural Language(such as English, Hindi, Telugu, Tamil etc) We use Natural Languages to communicate with humans whereas we use Programming Languages such as C, Cpp,...
V

Vamshi

0 0
0

Compiler vs Interpreter
Compiler Interpreter Convert all the code into binary format and execute. Convert one statement at a time and execute, then Convert next statement and execute. After conversion, source...

C Program-Infinite Loop[For] Demo
//Header Files #include<stdio.h>#include<conio.h> //Main function void main(){ //Function for clearing screen clrscr(); //Infinite for loop for(;;) { printf("Hello!"); } //Function for...
S

Efficient Learning Strategies
Type your notes after class Write your notes onto flashcards - Scrabble -Make posters Review flashcards while walking, at gym, etc. Dog-ear pages in the reading where you can find...

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more