Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!strath-cs!rmacgreg From: rmacgreg@cs.strath.ac.uk (Sorcerer) Newsgroups: comp.lang.c Subject: How to get the time... Summary: Or: How do I use ctime()... Message-ID: <5680@baird.cs.strath.ac.uk> Date: 18 Feb 91 09:31:39 GMT Distribution: comp.lang.c Organization: Comp. Sci. Dept., Strathclyde Univ., Scotland. Lines: 26 I'm trying to get the time and date using the ctime() function, but I've come up against a rather large problem... Ctime() expects a long int as an argument, but the manual doesn't say how or where you get this long int from. The manual gives: char *ctime(clock) long *clock; ctime() converts a long integer, pointed to by clock, to a 26-character string of the form produced by asctime() . It first breaks down clock to a struct tm by calling local- time(), and then calls asctime() to convert that struct tm to a string. Which is no help whatsoever. If it makes any difference I am on a Sun workstation running Un!x... The Sorcerer is 'Only visiting this planet' but can be found at: JANET: cadx862 @uk.ac.strathclyde.computer-centre-sun rmacgreg@uk.ac.strathclyde.computer-science INTERNET: via nsfnet-relay.ac.uk BITNET: via ukacrl UUCP: via ukc.uucp or second star to the right and straight on 'till morning.