Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   Misc

   Amazon

   Links

    


Using the strftime function
 

 

 

Description

This shows the strftime function . In this particular example we are returning the day but there are a number of other formats we can display.

Code

#include <time.h>
#include <stdio.h>

int main()
{
struct tm *ptr;
time_t tm;
char str[60];

tm = time(NULL);
ptr = localtime(&tm);
strftime(str ,100 , "It is %A.\n",ptr);
printf(str);

return 0;
}

Information

Tested in Visual C++6 and LCC win32.

A list of format commands can be found here

 

 

 

 

Download

localtime.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
search an array(php)
Play a sound using API(VB)
create a Microsoft Access database(VB)
File System of drive(ASP)
Power calculator(C)
Search an array(C)
deletes a folder(VB)
total amount of function keys(VB)

    




Copyright © 2003 by programmershelp.co.uk