⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dateformat.c

📁 kaffe是一个java虚拟机的源代码。里面包含了一些java例程和标准的java包。
💻 C
字号:
/* * java.text.DateFormat.c * * Copyright (c) 1996, 1997, 1998 *	Transvirtual Technologies, Inc.  All rights reserved. * * See the file "license.terms" for information on usage and redistribution  * of this file.  */#include "config.h"#include "config-std.h"#include "java_text_DateFormat.h"#include <time.h>#if defined(HAVE_STRFTIME)#define SIMPLETIME(S, T) strftime(S, sizeof(S), "%a %h %d %H:%M:%S %Z %Y", T)#define LOCALETIME(S, T) strftime(S, sizeof(S), "%a %h %d %H:%M:%S %Y", T)#define GMTTIME(S, T)    strftime(S, sizeof(S), "%d %h %Y %H:%M:%S GMT", T)#else#define SIMPLETIME(S, T) strcpy(S, asctime(T)); S[strlen(S)-1] = 0#define LOCALETIME(S, T) strcpy(S, asctime(T)); S[strlen(S)-1] = 0#define GMTTIME(S, T)	 strcpy(S, asctime(T)); S[strlen(S)-1] = 0#endifHjava_lang_String*java_text_DateFormat_format0(jlong time, int fmt){	time_t date;	char str[64];	date = time / 1000;	switch (fmt) {	case 0:		SIMPLETIME(str, localtime(&date));		break;	case 1:		LOCALETIME(str, localtime(&date));		break;	case 2:	default:		GMTTIME(str, localtime(&date));		break;	}	return (checkPtr(stringC2Java(str)));}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -