- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- OPEN VMS C
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2007 04:15 AM
тАО10-25-2007 04:15 AM
OPEN VMS C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2007 04:33 AM
тАО10-25-2007 04:33 AM
Re: OPEN VMS C
time_t t = time((time_t)9); printf(asctime(localtime(&t)));
Or you set up a $DESCRIPTOR and call SYS$ASCTIM().
cu,
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2007 05:25 AM
тАО10-25-2007 05:25 AM
Re: OPEN VMS C
http://www.eight-cubed.com/examples/framework.php?file=lib_sys_asctim.c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2007 06:44 AM
тАО10-25-2007 06:44 AM
Re: OPEN VMS C
http://www.eight-cubed.com/examples/framework.php?file=sys_asctim.c
As much as I prefer LIB$ routines when it comes to not using itemlists for just one item to retrieve, in this case and IMHO, $ASCTIM is easier to use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2007 12:25 PM
тАО10-25-2007 12:25 PM
Re: OPEN VMS C
char *timestamp(char *timestamp)
{
int n;
int csec; //centisecs
struct timeval tv;
struct tm *ptm;
gettimeofday(&tv,NULL);
ptm=localtime(&tv.tv_sec);
n=strftime(timestamp,20,"%Y-%m-%d %H:%M:%S",ptm);
csec=tv.tv_usec/10000;
sprintf(timestamp+n,".%2.2d",csec);
return timestamp;
}
here's a hack. with the year and day in the other order.
int szTime[8] = {23,(int)(szTime+2),0};
lib$date_time(szTime);
printf("%s\n",(char*)(szTime+2));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2007 11:52 AM
тАО10-26-2007 11:52 AM
Re: OPEN VMS C
Um, the same way you issue a printf for the system time in every other C implementation? This from K&R C forward through to the ANSI C and POSIX C calls and C99.
Others have addressed the direct C coding question.
I'm going to guess that you're wondering about the C/Unix epoch -- which is the same on OpenVMS as implemented on most (all?) other C platforms -- and the use of the native quadword time format, and UTC timekeeping.
I'd tend to use either the C/Unix epoch or the UTC calls if you're working in new code. Which depends on your particular goals and needs.
There are details on time and timekeeping in the OpenVMS FAQ (www.hoffmanlabs.com) and in the C RTL manual (www.hp.com/go/openvms/doc) with the newest C RTL manual now located in the main OpenVMS manual set and not in the C manual shelf.