Date representation as YY/DDD or YYYY/DDD

Wojciech Puchar wojtek at
Wed Jun 3 21:13:09 UTC 2009

> as 2009-01-01 would be 09/001, 2009-02-01 would be 2009/032.
> I've read "man date" and "man strftime", and it didn't look
> like this is already built in.
> What am I missing?
> If it's not invented yet, I'll do this on my own, but maybe
> I don't need to re-invent the wheel. :-)
#include <stdio.h>
#include <time.h>
main(int argc,char **argv) {
  time_t tmp1=time(0);
  struct tm tmp2;
  return 0;

started with no arguments gives YY/DDD, with any argument - YYYY/DDD

More information about the freebsd-questions mailing list