📄 getdate.gml
字号:
.func _dos_getdate
#include <&doshdr>
void _dos_getdate( struct dosdate_t *date );
struct dosdate_t {
unsigned char day; /* 1-31 */
unsigned char month; /* 1-12 */
unsigned short year; /* 1980-2099 */
unsigned char dayofweek;/* 0-6 (0=Sunday) */
};
.ixfunc2 '&DosFunc' &func
.funcend
.desc begin
The &func function uses system call 0x2A to get the current system date.
The date information is returned in a
.kw dosdate_t
structure pointed to by
.arg date.
.desc end
.return begin
The &func function has no return value.
.return end
.see begin
.seelist _dos_getdate _dos_gettime _dos_setdate _dos_settime gmtime localtime mktime time
.see end
.exmp begin
#include <stdio.h>
#include <&doshdr>
.exmp break
void main()
{
struct dosdate_t date;
struct dostime_t time;
.exmp break
/* Get and display the current date and time */
_dos_getdate( &.date );
_dos_gettime( &.time );
printf( "The date (MM-DD-YYYY) is: %d-%d-%d\n",
date.month, date.day, date.year );
printf( "The time (HH:MM:SS) is: %.2d:%.2d:%.2d\n",
time.hour, time.minute, time.second );
}
.exmp output
The date (MM-DD-YYYY) is: 12-25-1989
The time (HH:MM:SS) is: 14:23:57
.exmp end
.class DOS
.system
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -