Operating System - OpenVMS
1753903 Members
10190 Online
108810 Solutions
New Discussion юеВ

Converting Unix timestamp to VMS

 
Dana Vraspir
New Member

Converting Unix timestamp to VMS

I need to find a C function that can be passed a Unix timestamp (unsigned long), and return a managable (readable) date time format.
5 REPLIES 5
Antoniov.
Honored Contributor

Re: Converting Unix timestamp to VMS

I don't understand your question; in C over VMS you can use all unix function and all structure of unix time.
Please post more info for furthermore help.

Bye
Antoniov
Antonio Maria Vigliotti
Brad McCusker
Respected Contributor

Re: Converting Unix timestamp to VMS

Wouldn't ctime() do what you want?

Your question is not clear, perhaps you don't have an understanding of the time functions available on VMS? Please reference the latest copy of the HP C Run-Time Library Reference Manual for OpenVMS Systems, specifically chapter 11 which deals with date and time functions. It is available on line at: http://h71000.www7.hp.com/doc/732FINAL/5763/5763pro_019.html#date_time_chap

If that doesn't help answer the question, please give us some more details, and we can try to help.

Regards,

Brad McCusker
VMS Engineering
Brad McCusker
Software Concepts International
Peter Skoog
Occasional Contributor

Re: Converting Unix timestamp to VMS

Hi,

Take a look at strftime in C runtime which is used to format a struct tm.

Example:

time_t tp;
char ts[100];
time( &tp );
strftime( ts, 99, "%Y-%m-%d %H:%M:%S",
localtime( &tp ) );

Regards
Peter
Dana Vraspir
New Member

Re: Converting Unix timestamp to VMS

Yes - ctime() does just what I wanted.
A little more research on my part would have answered this.

Thank you!
Vouters
Advisor

Re: Converting Unix timestamp to VMS