Re: How can I cause the datetime to be the name of the output file.....




"Merlin" <mrb7494@xxxxxxxxx> wrote in message
news:1139110037.599303.31330@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello everyone,


Merlin? Interesting nick...

Would time.h be the right library to use? If so, does anyone have any
suggestions as to how a solution might be implemented? Any thoughts
would be greatly appreciated.

Yes, it can be.
Yes, I do.

The first thing to consider, before which functions to use, is the time
format and time zone. It would be best if you used military 24-hour time,
so that say a 3pm and 3am file don't have a filename collision. Also, since
Daylight Saving Time shifts the hour by one, it would probably be best to
use a timezone independent time reference such as UTC, GMT, or Zulu time.

If your time.h has strftime(), you could use it with gmtime(). If not, you
can construct a "strftime()" using gmtime() and sprintf().


Rod Pemberton


.



Relevant Pages

  • Re: How to compute time into integer?
    ... >> time, asctime(), localtime, gmtime, ctimein time.h file. ... if applicable) called "broken down", to *UTC* time in time_t, which is ... is not actually required by the standard. ... GMT, for example in the name of gmtime(), although technically that is ...
    (comp.lang.c)
  • RE: time.strftime Timezone issue
    ... > As it turns out it was my mistake for using gmtime() not localtime. ... > I would assume it would change to UTC. ... a time zone member, so strftime has no idea which time zone the struct tm ... Its idea of whether daylight time is in effect comes from its argument's ...
    (comp.lang.python)
  • Re: Time problem....mktime(), gmtime(), localtime()
    ... > this time_t returned is of the local time, not UTC. ... > gmtime() also takes in one argument of time_t but returns a tm ... because of seasonal adjustments ("daylight ...
    (comp.lang.c)
  • Re: time structure without shift
    ... GMT+0) but gmtime() suppose time value in local time. ... epoch *UTC* In our context, UTC means exactly the same as GMT. ... $ perl -le'print scalar localtime' Fri Mar 23 22:35:00 2007 $ perl -le'$ENV="GMT"; print scalar localtime' Sat Mar 24 02:35:00 2007 ...
    (comp.lang.perl.misc)
  • Re: How to compute time into integer?
    ... >> GMT, for example in the name of gmtime(), although technically that is ... > Strictly speaking, a time_t value is neither local time nor UTC. ... implementation with the switch-timezone-setting usage I was preparing ...
    (comp.lang.c)