Unix time function

Unix time function

Post by John Hax » Wed, 10 May 1995 04:00:00

|> Unix time function gives the seconds since 00:00:00 Jan 1970. Is there any way I can
|> represent the time previous to 1970 (for e.g. 1950, 1940 etc.)?.

On every UNIX system I've ever used, time_t (the type for time) is  signed, in
fact its almost always 32 bits.  This means negative time values go from about
1901 to just before midnight, New Year's Eve, 1969.


ISODE Consortium                                        +44 181 332 9091

These are my opinions and have nothing to do with my employer.


1. Unix time functions and timezones


I want to write the following C function under Unix :

This function has to convert a date according to a specific timezone.

The parameters have to be :
- A date ( Format : YYYYMMDDHHMISS ) given in a specific time zone.
- A timezone ( Ex : PSD8PDT) which has to be used to convert the date.

For example :

If the date in input is "20010417180010" ( given in PSD8PDT) and the
timezone which has to be used is UCT-5:30, the new date has to be converted
according to UCT-5:30.

I looked at different UNIX functions like ctime, localtime ... and thought
about modifying the TZ variable. But my problem is to handle the daylight
saving times.

For example, "20010117180010" was the local date and time in the USA in
january. It means that the daylight savings time wasn't in effect. How to
convert this date now (when the daylight savings time is in effect in the
USA) according to the UCT-5:30 timezone where the daylight savings time may
not exist ? I mean it isn't really usefull to modify the TZ variable in this

Does anyone know a function or has a clue about this problem ?


Get your FREE download of MSN Explorer at http://explorer.msn.com

Posted from [] by way of f82.law14.hotmail.com []
via Mailgate.ORG Server - http://www.Mailgate.ORG

2. NIS Error and Windows Emulation

3. leap seconds in Unix time functions

4. CONSOLE window in X gets no messages - HELP!

5. >1 second granularity unix time functions

6. Printer Problems

7. time function in UNIX

8. Help about SCSI DAT Tape

9. C function execution time measurement under UNIX

10. time() function in time.h

11. Need help with 'time' C Run-Time Library functions under HP-UX

12. Recommended time function for time stamp within a device driver?

13. function, function...who's got the function?