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

Program to accept a list of elements and find the maximum number in the list. 

 

The logic will be 1. Create an array of the desired type 2. Sort the array in the descending order 3. Fetch the first elemnet from the array, this will be the maximum element in that array. Now use...
Lavanya
0 0
8
What is the difference between #include and #include "file" ?
Follow the link for the explanation : http://www.programmingprashn.com/2015/08/what-is-difference-between-include-and.html
Kajol
Why is C programming language called C?
The C programming language is named "C" because it is a successor to the B programming language. The B language was developed at Bell Labs by Ken Thompson and Dennis Ritchie. When they created C, they...
Ashwini
0 0
6
How do I check my C programming skills?
You should try to solve your daily life problems with c , i.e - build your own budget calculator or chess game and many more. Moreover make a habbit of solving 10 questions daily.
Ramnarayanan
0 0
5
What is a local block in C programming?
the statements within the braces { } is known as local block
Rakhi
0 0
6

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

Ask a Question

Related Lessons

Creating First Program Using C Language
Step 1: Install and setup Turbo C compiler on your computer. Step 2: Open Turbo C from your Desktop or Programs menu. Select “File” from menu bar and select option “New”. Step...

How do i get best Campus / Off Campus Placement?
Companies are looking for Skilled Freshers. So build your technical skills while doing MCA / BTech / BCA / BSc (IT or CS) into below areas- 1. Strong your programming & debugging skills ...

An Interesting discussion about malloc( ) and calloc( )
What are malloc( ) and calloc( )? Simply putting they are the predefined functions in C language. Malloc( ) and calloc( ) are two such functions which are used for more or less identical purpose and...

C Program-Vowels and Consonants
/*WAP to print the character entered by user is a vowel or consonant*/ //Header files #include<stdio.h>#include<conio.h> //Main functionvoid main(){ char c; //Function for clearing screen...
S

Java and C trainer
Always think any conspect with real-time example like Object -- object must have states and behaviour then only we will call that thing is Object like fan is Object (rotating,color)

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 >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

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