Next: PSX_MALLOC - Allocate virtual memory
Up: Routine Descriptions
Previous: PSX_ISATTY - Determine if a file is a terminal
PSX_LOCALTIME
- Convert the value returned by PSX_TIME to individual local time values
- Description:
- Convert the value returned by PSX_TIME into a set of usable
numbers expressed in local time, and a pointer to the corresponding C
structure.
- Invocation:
- CALL PSX_LOCALTIME( NTICKS, SECS, MINS, HOURS, DAY, MONTH, YEAR,
: WDAY, YDAY, ISDST, TSTRCT, STATUS )
- Arguments:
-
-
NTICKS = INTEGER (Given)
-
The number of ticks since the start of the calendar.
-
SECS = INTEGER (Returned)
-
The number of seconds in the current time.
-
MINS = INTEGER (Returned)
-
The number of minutes in the current time.
-
HOURS = INTEGER (Returned)
-
The number of hours in the current time.
-
DAY = INTEGER (Returned)
-
The number of the day of the month.
-
MONTH = INTEGER (Returned)
-
The number of the month in the year.
-
YEAR = INTEGER (Returned)
-
The number of the years since 1900.
-
WDAY = INTEGER (Returned)
-
The number of the day in the week.
-
YDAY = INTEGER (Returned)
-
The number of the day in the year.
-
ISDST = INTEGER (Returned)
-
Daylight savings time flag.
-
TSTRCT = POINTER (Returned)
-
A pointer to the C time structure.
-
STATUS = INTEGER (Given)
-
The global status.
- Notes:
- The value of MONTH is 0 for January, 1 for February, etc. This
is to maintain compatibility with the C run time library.
- The value of YEAR is 0 for 1900, 100 for 2000, 101 for 2001, etc.
- The value of YDAY is 0 for the first of January, 1 for the
second of January, etc. This is to maintain compatibility with
the C run time library.
- The value of WDAY is 0 for Sunday, 1 for Monday, etc.
- The value of ISDST is 1 when daylight saving time is in effect,
0 when it is not and -1 when the information is not available.
- The pointer TSTRCT points to the C structure that contains the
information about the time. This pointer is needed as it may be
passed on to
PSX_ASCTIME.
The structure will be overwritten by any future call to
PSX_LOCALTIME or
PSX_GMTIME.
- TSTRCT is declared to be of type POINTER. This is usually
represented in FORTRAN as an INTEGER, although any type that
uses the same amount of storage would be just as good.
-
External Routines Used
- cnf: cnfFptr, cnfMalloc
-
References
- POSIX standard (1988), section 4.2.1
- ANSI C standard (1989), section 4.12.3.4
-
Copyright
- Copyright (C) 1991 Science & Engineering Research Council
Next: PSX_MALLOC - Allocate virtual memory
Up: Routine Descriptions
Previous: PSX_ISATTY - Determine if a file is a terminal
PSX POSIX interface routines
Starlink User Note 121
P M Allan
A J Chipperfield
10 April 2003
E-mail:ussc@star.rl.ac.uk
Copyright © 2000 Council for the Central Laboratory of the Research Councils