sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * FUNCTION sl@0: * <>---convert time to UTC traditional form sl@0: * INDEX sl@0: * gmtime sl@0: * ANSI_SYNOPSIS sl@0: * #include sl@0: * struct tm *gmtime(const time_t *<[clock]>); sl@0: * struct tm *gmtime_r(const time_t *<[clock]>, struct tm *<[res]>); sl@0: * TRAD_SYNOPSIS sl@0: * #include sl@0: * struct tm *gmtime(<[clock]>) sl@0: * const time_t *<[clock]>; sl@0: * struct tm *gmtime_r(<[clock]>, <[res]>) sl@0: * const time_t *<[clock]>; sl@0: * struct tm *<[res]>; sl@0: * <> assumes the time at <[clock]> represents a local time. sl@0: * <> converts it to UTC (Universal Coordinated Time, also known in some sl@0: * countries as GMT, Greenwich Mean time), then converts the sl@0: * representation from the arithmetic representation to sl@0: * the traditional representation defined by <>. sl@0: * <> constructs the traditional time representation in static sl@0: * storage; each call to <> or <> will overwrite the sl@0: * information generated by previous calls to either function. sl@0: * RETURNS sl@0: * A pointer to the traditional time representation (<>). sl@0: * PORTABILITY sl@0: * ANSI C requires <>. sl@0: * <> requires no supporting OS subroutines. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #ifndef _REENT_ONLY sl@0: sl@0: /** sl@0: Convert time_t value to tm structure as UTC time. sl@0: Converts timer to tm structure adjusting to sl@0: UTC (formerly known as GMT) timezone. sl@0: @return A pointer to a tm structure. sl@0: This structure is statically allocated and shared by gmtime, sl@0: localtime and ctime functions. sl@0: Each time one of these functions is called the content of sl@0: the structure is overwritten. sl@0: @param tim_p pointer to a time_t value, sl@0: usually returned by time function. sl@0: */ sl@0: EXPORT_C struct tm * sl@0: gmtime (const time_t * tim_p) sl@0: { sl@0: return gmtime_r (tim_p, &(_REENT->_struct_tm)); sl@0: } sl@0: sl@0: #endif