jctime.c
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 80 行
C
80 行
/****************************************************************************
*
* Open Watcom Project
*
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
*
* This file contains Original Code and/or Modifications of Original
* Code as defined in and that are subject to the Sybase Open Watcom
* Public License version 1.0 (the 'License'). You may not use this file
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
* provided with the Original Code and Modifications, and is also
* available at www.sybase.com/developer/opensource.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
* NON-INFRINGEMENT. Please see the License for the specific language
* governing rights and limitations under the License.
*
* ========================================================================
*
* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
* DESCRIBE IT HERE!
*
****************************************************************************/
#include "variety.h"
#include <jtime.h>
#include <time.h>
/**
*
* Name: jctime
*
* Synopsis: s = jctime( timer )
*
* char *s; ASCII 暥帤楍
* time_t *timer; 昩扨埵偺帪娫(long 宆)
*
* Description: timer 偑巜偡 long int 宆偺抣傪 jasctime() 偑曉偡宍幃偺 ASCII
* 暥帤楍偵曄姺偡傞丅
*
* 擖椡帪崗偼丄 GMT 偱昞帵偝傟偰偄側偗傟偽側傜側偄丅偙偺娭悢偺
* 撪晹偱 timezone 偱帵偝傟傞帪嵎傪堷偔偙偲偱丄抧曽帪傪嶼弌
* 偟偰偄傞丅
*
* Name: jctime
*
* Synopsis: s = jctime( timer )
*
* char *s; ASCII string returned
* time_t *timer; long (seconds) input
*
* Description: Converts the long integer pointed to by timer to an ASCII
* string in the form returned by jasctime().
*
* Note that this function expects its input to be expressed
* as GMT and it converts to local time by subtracting the
* timezone bias.
*
**/
_WCRTLINK unsigned char *jctime( const time_t *timer )
{
/* JBS 92/09/30
time_t x;
tzset();
x = *timer - timezone;
return( jasctime( gmtime( &x ) ) );
*/
return( jasctime( localtime( timer ) ) );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?