View Single Post
Old 07-03-2005, 12:28 AM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
I'm too hung over, to even explain, so here is a code example.
Code:
#include <stdio.h>
#include <time.h>

int main()
{
  struct tm *tm_set;
  time_t tim, t;
  tim = time(&t);
  tm_set = localtime(&tim);
  printf("HHMM: %.2d%.2d\n", tm_set->tm_hour, tm_set->tm_min);
  printf("DDMMYY: %.2d%.2d%.2d\n", tm_set->tm_mday, tm_set->tm_mon,
             (tm_set->tm_year < 100)? tm_set->tm_year: (tm_set->tm_year -100));
  return 0;
}
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote