T.R | Title | User | Personal Name | Date | Lines |
---|
1828.1 | Y2K is upon us. | STAR::GOLDENBERG | Ruth Goldenberg | Thu Feb 20 1997 12:34 | 7 |
| re .0
Sorry I can't help with the C question, but couldn't resist asking
isn't this the wrong end of the millenium to be generating 2-digit
date strings? {;)
ruth
|
1828.2 | | EEMELI::MOSER | Orienteers do it in the bush... | Thu Feb 20 1997 14:35 | 11 |
|
I'd use 'strftime' with which you can do fancy conversions,
including 4-digit years etc. The snippet below is just an
example to display the current time in a format I like.
ftime ( &now );
tm_ptr = localtime ( &now.time );
i = strftime ( timestamp, 32, "%d-%b-%Y %T", tm_ptr );
/cmos
|
1828.3 | | MOVIES::WIDDOWSON | Rod | Fri Feb 21 1997 04:45 | 1 |
| Yet more C from Mr Moser ;-)
|
1828.4 | 50% there!!! | CHEFS::WILLIAMSA | I wanna be Luke | Fri Feb 21 1997 05:02 | 16 |
| Re .1
I couldn't agree more, I am all too aware of the problems of Y2K,
however the code I'm writing is having to interogate customer generated
files, and the customer is the one using this naming convention,
despite our protestations (sp?).
Re .2
Perfect, just what I needed! Thankyou very much.
As for the seconds to time business, if anyone could tell me how to do
a division and then stick the remainder somewhere, or how about right
justifying (with a zero) a string???
Alen.
|
1828.5 | | EEMELI::MOSER | Orienteers do it in the bush... | Fri Feb 21 1997 05:58 | 6 |
| re: .3
I would never dare to put any of my C code frags into the DECC
notesfile, HACKERS is just fine... :-)
/cmos
|
1828.6 | DEC C Conference Would Be Better Spot... | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Fri Feb 21 1997 09:44 | 18 |
|
: I also need something that will generate as a char string the date in
: the format YYMMDD.
There are RTL services present in the LIB manual that handle just about
any format date or time you would want to use... LIB$FORMAT_DATE_TIME,
LIB$GET_DATE_FORMAT, et al.
If running OpenVMS V6.2 or later, see the locale support -- specifically,
see the LC_TIME stuff -- the field descriptors %y%m%d would provide the
requested two-digit YYMMDD format. (This stuff is stock C, if one needs
code portability...)
As Ruth indicates, I'd recommend running a test with the software at this
site -- set the date to something nearer 2000 -- and see what breaks...
And I'd make *very* sure that the customer overrode DIGITAL's express
objections to using a two-digit year IN WRITING.
|
1828.7 | Another snippet of "C" | THEWAV::TAKASHIMA | | Sun Feb 23 1997 03:30 | 3 |
| Re: .4
printf ("%05d\n", 42 % 39);
|