IT. Expert System.

C

strftime()


This function is used to modify the actual time format

Syntax:
size_t strftime(char *str, size_t maxsize, const char *format, const struct tm *timeptr)


Example:

#include 
#include 

#define LEN 150
int main ()
{
   char buf[LEN];
   time_t curtime;
   struct tm *loc_time;

   //Getting current time of system
   curtime = time (NULL);

   // Converting current time to local time
   loc_time = localtime (&curtime);

   // Displaying date and time in standard format
   printf("%s", asctime (loc_time));

   strftime (buf, LEN, "Today is %A, %b %d.\n", loc_time);
   fputs (buf, stdout);
   strftime (buf, LEN, "Time is %I:%M %p.\n", loc_time);
   fputs (buf, stdout);

   return 0;
}
Output:

Mon Oct 14 01:15:03 2014
Today is Saturday, Oct 14,
Time is 01:15 AM. 


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 302 / 158732973. Delta: 0.00304 с