Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sealfin
Created May 31, 2014 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sealfin/6d35f3a3958bd6797a0f to your computer and use it in GitHub Desktop.
Save sealfin/6d35f3a3958bd6797a0f to your computer and use it in GitHub Desktop.
#include "printDateAndTime.h"
#include <time.h>
#include <stdio.h>
void p_PrintDateAndTime( void )
{
time_t t_0;
struct tm *t_1;
char s[ 26 ];
time( &t_0 );
t_1 = localtime( &t_0 );
strftime( s, 26, "%a %b %d %H:%M:%S %Y\n", t_1 );
printf( s );
}
#ifndef printDateAndTime_h
#define printDateAndTime_h
#ifdef __cplusplus
extern "C"
{
#endif
void p_PrintDateAndTime( void );
#ifdef __cplusplus
}
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment